added _(...).filter/_(...).select defs

This commit is contained in:
Brian Zengel
2013-10-21 10:36:17 -04:00
parent bd000082ba
commit d3327b7ef8
2 changed files with 54 additions and 0 deletions
+8
View File
@@ -301,10 +301,18 @@ result = <number[]>_.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 =
result = <IFoodCombined[]>_.filter(foodsCombined, 'organic');
result = <IFoodCombined[]>_.filter(foodsCombined, { 'type': 'fruit' });
result = <number[]>_([1, 2, 3, 4, 5, 6]).filter(function(num) { return num % 2 == 0; });
result = <IFoodCombined[]>_(foodsCombined).filter('organic');
result = <IFoodCombined[]>_(foodsCombined).filter({ 'type': 'fruit' });
result = <number[]>_.select([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
result = <IFoodCombined[]>_.select(foodsCombined, 'organic');
result = <IFoodCombined[]>_.select(foodsCombined, { 'type': 'fruit' });
result = <number[]>_([1, 2, 3, 4, 5, 6]).select(function(num) { return num % 2 == 0; });
result = <IFoodCombined[]>_(foodsCombined).select('organic');
result = <IFoodCombined[]>_(foodsCombined).select({ 'type': 'fruit' });
result = <number>_.find([1, 2, 3, 4], function(num) {
return num % 2 == 0;
});
+46
View File
@@ -1227,6 +1227,29 @@ declare module _ {
collection: Collection<T>,
whereValue: Dictionary<any>): T[];
interface LoDashWrapper<T> {
/**
* @see _.filter
**/
filter<T>(
callback: ListIterator<T, boolean>,
thisArg?: any): T[];
/**
* @see _.filter
* @param pluckValue _.pluck style callback
**/
filter<T>(
pluckValue: string): T[];
/**
* @see _.filter
* @param pluckValue _.pluck style callback
**/
filter<T>(
whereValue: Dictionary<any>): T[];
}
/**
* @see _.filter
**/
@@ -1251,6 +1274,29 @@ declare module _ {
collection: Collection<T>,
whereValue: Dictionary<any>): T[];
interface LoDashWrapper<T> {
/**
* @see _.filter
**/
select<T>(
callback: ListIterator<T, boolean>,
thisArg?: any): T[];
/**
* @see _.filter
* @param pluckValue _.pluck style callback
**/
select<T>(
pluckValue: string): T[];
/**
* @see _.filter
* @param pluckValue _.pluck style callback
**/
select<T>(
whereValue: Dictionary<any>): 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;