Merge pull request #1294 from tmmueller/lodash/chained/filter

fixed _(...).filter/_(...).select defs to allow further chaining
This commit is contained in:
Basarat Ali Syed
2013-11-19 18:22:55 -08:00
2 changed files with 12 additions and 12 deletions

View File

@@ -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
View File

@@ -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