diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 86c79372e..97738b58f 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -301,10 +301,18 @@ result = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 = result = _.filter(foodsCombined, 'organic'); result = _.filter(foodsCombined, { 'type': 'fruit' }); + result = _([1, 2, 3, 4, 5, 6]).filter(function(num) { return num % 2 == 0; }); + result = _(foodsCombined).filter('organic'); + result = _(foodsCombined).filter({ 'type': 'fruit' }); + result = _.select([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); result = _.select(foodsCombined, 'organic'); result = _.select(foodsCombined, { 'type': 'fruit' }); + result = _([1, 2, 3, 4, 5, 6]).select(function(num) { return num % 2 == 0; }); + result = _(foodsCombined).select('organic'); + result = _(foodsCombined).select({ 'type': 'fruit' }); + result = _.find([1, 2, 3, 4], function(num) { return num % 2 == 0; }); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index b4f745b0b..43be6684f 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1227,6 +1227,29 @@ declare module _ { collection: Collection, whereValue: Dictionary): T[]; + interface LoDashWrapper { + /** + * @see _.filter + **/ + filter( + callback: ListIterator, + thisArg?: any): T[]; + + /** + * @see _.filter + * @param pluckValue _.pluck style callback + **/ + filter( + pluckValue: string): T[]; + + /** + * @see _.filter + * @param pluckValue _.pluck style callback + **/ + filter( + whereValue: Dictionary): T[]; + } + /** * @see _.filter **/ @@ -1251,6 +1274,29 @@ declare module _ { collection: Collection, whereValue: Dictionary): T[]; + interface LoDashWrapper { + /** + * @see _.filter + **/ + select( + callback: ListIterator, + thisArg?: any): T[]; + + /** + * @see _.filter + * @param pluckValue _.pluck style callback + **/ + select( + pluckValue: string): T[]; + + /** + * @see _.filter + * @param pluckValue _.pluck style callback + **/ + select( + whereValue: Dictionary): T[]; + } + /** * Iterates over elements of a collection, returning the first element that the callback * returns truey for. The callback is bound to thisArg and invoked with three arguments;