diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index d095bb9122..18c3cadd6f 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -395,10 +395,18 @@ result = _.map([1, 2, 3], function(num) { return num * 3; }); result = _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); result = _.map(stoogesAges, 'name'); + result = _([1, 2, 3]).map(function(num) { return num * 3; }).value(); + result = _({ 'one': 1, 'two': 2, 'three': 3 }).map(function(num) { return num * 3; }).value(); + result = _(stoogesAges).map('name').value(); + result = _.collect([1, 2, 3], function(num) { return num * 3; }); result = _.collect({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); result = _.collect(stoogesAges, 'name'); + result = _([1, 2, 3]).collect(function(num) { return num * 3; }).value(); + result = _({ 'one': 1, 'two': 2, 'three': 3 }).collect(function(num) { return num * 3; }).value(); + result = _(stoogesAges).collect('name').value(); + result = _.max([4, 2, 8, 6]); result = _.max(stoogesAges, function(stooge) { return stooge.age; }); result = _.max(stoogesAges, 'age'); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index b8e59dc72b..aa303a0436 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1913,6 +1913,51 @@ declare module _ { pluckValue: string): TResult[]; } + interface LoDashArrayWrapper { + /** + * @see _.map + **/ + map( + callback: ListIterator, + thisArg?: any): LoDashArrayWrapper; + + /** + * @see _.map + * @param pluckValue _.pluck style callback + **/ + map( + pluckValue: string): LoDashArrayWrapper; + + /** + * @see _.map + **/ + collect( + callback: ListIterator, + thisArg?: any): LoDashArrayWrapper; + + /** + * @see _.map + **/ + collect( + pluckValue: string): LoDashArrayWrapper; + } + + interface LoDashObjectWrapper { + /** + * @see _.map + **/ + map( + callback: ObjectIterator, + thisArg?: any): LoDashObjectWrapper; + + /** + * @see _.map + **/ + collect( + callback: ObjectIterator, + thisArg?: any): LoDashObjectWrapper; + } + //_.max interface LoDashStatic { /**