diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index e35b59d7e9..a869fd0a9b 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -380,6 +380,10 @@ result = <_.Dictionary>_.groupBy([4.2, 6.1, 6.4], function(num) { retu result = <_.Dictionary>_.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); result = <_.Dictionary>_.groupBy(['one', 'two', 'three'], 'length'); + result = <_.LoDashObjectWrapper<_.Dictionary>>_([4.2, 6.1, 6.4]).groupBy(function(num) { return Math.floor(num); }); + result = <_.LoDashObjectWrapper<_.Dictionary>>_([4.2, 6.1, 6.4]).groupBy(function(num) { return this.floor(num); }, Math); + result = <_.LoDashObjectWrapper<_.Dictionary>>_(['one', 'two', 'three']).groupBy('length'); + result = <_.Dictionary>_.indexBy(keys, 'dir'); result = <_.Dictionary>_.indexBy(keys, function(key) { return String.fromCharCode(key.code); }); result = <_.Dictionary>_.indexBy(keys, function(key) { this.fromCharCode(key.code); }, String); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 67f9153450..f8af63ad24 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1761,6 +1761,27 @@ declare module _ { whereValue: W): Dictionary; } + interface LoDashArrayWrapper { + /** + * @see _.groupBy + **/ + groupBy( + callback: ListIterator, + thisArg?: any): _.LoDashObjectWrapper>; + + /** + * @see _.groupBy + **/ + groupBy( + pluckValue: string): _.LoDashObjectWrapper>; + + /** + * @see _.groupBy + **/ + groupBy( + whereValue: W): _.LoDashObjectWrapper>; + } + //_.indexBy interface LoDashStatic { /**