mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 11:57:33 +08:00
Merge pull request #1294 from tmmueller/lodash/chained/filter
fixed _(...).filter/_(...).select defs to allow further chaining
This commit is contained in:
@@ -316,17 +316,17 @@ 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[]>_([1, 2, 3, 4, 5, 6]).filter(function(num) { return num % 2 == 0; }).value();
|
||||
result = <IFoodCombined[]>_(foodsCombined).filter('organic').value();
|
||||
result = <IFoodCombined[]>_(foodsCombined).filter({ 'type': 'fruit' }).value();
|
||||
|
||||
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[]>_([1, 2, 3, 4, 5, 6]).select(function(num) { return num % 2 == 0; }).value();
|
||||
result = <IFoodCombined[]>_(foodsCombined).select('organic').value();
|
||||
result = <IFoodCombined[]>_(foodsCombined).select({ 'type': 'fruit' }).value();
|
||||
|
||||
result = <number>_.find([1, 2, 3, 4], function(num) {
|
||||
return num % 2 == 0;
|
||||
|
||||
12
lodash/lodash.d.ts
vendored
12
lodash/lodash.d.ts
vendored
@@ -1413,42 +1413,42 @@ declare module _ {
|
||||
**/
|
||||
filter<T>(
|
||||
callback: ListIterator<T, boolean>,
|
||||
thisArg?: any): T[];
|
||||
thisArg?: any): LoDashArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.filter
|
||||
* @param pluckValue _.pluck style callback
|
||||
**/
|
||||
filter<T>(
|
||||
pluckValue: string): T[];
|
||||
pluckValue: string): LoDashArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.filter
|
||||
* @param pluckValue _.pluck style callback
|
||||
**/
|
||||
filter<W, T extends W>(
|
||||
whereValue: W): T[];
|
||||
whereValue: W): LoDashArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.filter
|
||||
**/
|
||||
select<T>(
|
||||
callback: ListIterator<T, boolean>,
|
||||
thisArg?: any): T[];
|
||||
thisArg?: any): LoDashArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.filter
|
||||
* @param pluckValue _.pluck style callback
|
||||
**/
|
||||
select<T>(
|
||||
pluckValue: string): T[];
|
||||
pluckValue: string): LoDashArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.filter
|
||||
* @param pluckValue _.pluck style callback
|
||||
**/
|
||||
select<W, T extends W>(
|
||||
whereValue: W): T[];
|
||||
whereValue: W): LoDashArrayWrapper<T>;
|
||||
}
|
||||
|
||||
//_.find
|
||||
|
||||
Reference in New Issue
Block a user