mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
added _(...).filter/_(...).select defs
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
Vendored
+46
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user