diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 12078ca9e..fc8f8a527 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -693,10 +693,18 @@ result = _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, k console.log(key); }); + result = <_.LoDashObjectWrapper>_({ '0': 'zero', '1': 'one', 'length': 2 }).forOwn(function(num, key) { + console.log(key); + }); + result = _.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { console.log(key); }); + result = <_.LoDashObjectWrapper>_({ '0': 'zero', '1': 'one', 'length': 2 }).forOwnRight(function(num, key) { + console.log(key); + }); + result = _.functions(_); result = _.methods(_); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index c3084a3e6..a87952679 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -3251,8 +3251,8 @@ declare module _ { * @see _.forIn **/ forIn( - callback?: ObjectIterator, - thisArg?: any): Dictionary; + callback: ObjectIterator, + thisArg?: any): _.LoDashObjectWrapper; } //_.forInRight @@ -3276,8 +3276,8 @@ declare module _ { * @see _.forInRight **/ forInRight( - callback?: ObjectIterator, - thisArg?: any): Dictionary; + callback: ObjectIterator, + thisArg?: any): _.LoDashObjectWrapper; } //_.forOwn @@ -3297,6 +3297,15 @@ declare module _ { thisArg?: any): Dictionary; } + interface LoDashObjectWrapper { + /** + * @see _.forOwn + **/ + forOwn( + callback: ObjectIterator, + thisArg?: any): _.LoDashObjectWrapper; + } + //_.forOwnRight interface LoDashStatic { /** @@ -3313,6 +3322,15 @@ declare module _ { thisArg?: any): Dictionary; } + interface LoDashObjectWrapper { + /** + * @see _.forOwnRight + **/ + forOwnRight( + callback: ObjectIterator, + thisArg?: any): _.LoDashObjectWrapper; + } + //_.functions interface LoDashStatic { /**