diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 2161f4a95..0fadd6ca0 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -377,6 +377,12 @@ result = >_.forEachRight({ 'one': 1, 'two': 2, 'three' result = _.eachRight([1, 2, 3], function(num) { console.log(num); }); result = >_.eachRight({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); }); + result = >_([1, 2, 3]).forEachRight(function(num) { console.log(num); }); + result = >>_({ 'one': 1, 'two': 2, 'three': 3 }).forEachRight(function(num) { console.log(num); }); + + result = >_([1, 2, 3]).eachRight(function(num) { console.log(num); }); + result = >>_({ 'one': 1, 'two': 2, 'three': 3 }).eachRight(function(num) { console.log(num); }); + result = >_.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); }); result = >_.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); result = >_.groupBy(['one', 'two', 'three'], 'length'); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 78bf718a4..0979f2ccb 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1589,7 +1589,7 @@ declare module LoDash { thisArg?: any): List; /** - * @see _.each + * @see _.forEachRight **/ forEachRight( object: Dictionary, @@ -1597,7 +1597,7 @@ declare module LoDash { thisArg?: any): Dictionary; /** - * @see _.each + * @see _.forEachRight **/ eachRight( collection: List, @@ -1605,7 +1605,7 @@ declare module LoDash { thisArg?: any): List; /** - * @see _.each + * @see _.forEachRight * @param object The object to iterate over * @param callback The function called per iteration. * @param thisArg The this binding of callback. @@ -1616,6 +1616,41 @@ declare module LoDash { thisArg?: any): Dictionary; } + interface LoDashArrayWrapper { + /** + * @see _.forEachRight + **/ + forEachRight( + callback: ListIterator, + thisArg?: any): LoDashArrayWrapper>; + + /** + * @see _.forEachRight + **/ + eachRight( + callback: ListIterator, + thisArg?: any): LoDashArrayWrapper>; + } + + interface LoDashObjectWrapper { + /** + * @see _.forEachRight + **/ + forEachRight( + callback: ObjectIterator, + thisArg?: any): LoDashObjectWrapper>; + + /** + * @see _.forEachRight + * @param object The object to iterate over + * @param callback The function called per iteration. + * @param thisArg The this binding of callback. + **/ + eachRight( + callback: ObjectIterator, + thisArg?: any): LoDashObjectWrapper>; + } + //_.groupBy interface LoDashStatic { /**