mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-06 17:29:08 +00:00
lodash: add generic _.remove
This commit is contained in:
@@ -270,6 +270,7 @@ result = <number[]>_.range(0);
|
||||
result = <number[]>_.remove([1, 2, 3, 4, 5, 6], function (num: number) { return num % 2 == 0; });
|
||||
result = <IFoodOrganic[]>_.remove(foodsOrganic, 'organic');
|
||||
result = <IFoodType[]>_.remove(foodsType, { 'type': 'vegetable' });
|
||||
var typedResult: IFoodType[] = _.remove([ <IFoodType>{ name: 'apple' }, <IFoodType>{ name: 'orange' }], <IFoodType>{ name: 'orange' });
|
||||
|
||||
result = <number>_.sortedIndex([20, 30, 50], 40);
|
||||
result = <number>_.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
|
||||
|
||||
8
lodash/lodash.d.ts
vendored
8
lodash/lodash.d.ts
vendored
@@ -1296,6 +1296,14 @@ declare module _ {
|
||||
remove(
|
||||
array: List<any>,
|
||||
wherealue?: Dictionary<any>): any[];
|
||||
|
||||
/**
|
||||
* @see _.remove
|
||||
* @param item The item to remove
|
||||
**/
|
||||
remove<T>(
|
||||
array:Array<T>,
|
||||
item:T): T[];
|
||||
}
|
||||
|
||||
//_.rest
|
||||
|
||||
Reference in New Issue
Block a user