mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-05 12:20:07 +08:00
Based on http://underscorejs.org/
and the test
```
var x = [ {value:123},{value:456}];
_.pluck(x,'value')
```
returns [123, 456]
This commit is contained in:
1 parent
09be3956b6
commit
13f2ff5f3f
1 file changed
+3
-3
Vendored
+3
-3
@@ -368,11 +368,11 @@ declare module _ {
|
||||
* property values.
|
||||
* @param list The list to pluck elements out of that have the property `propertyName`.
|
||||
* @param propertyName The property to look for on each element within `list`.
|
||||
* @return The list of elements within `list` that have the property `propertyName`.
|
||||
* @return The list of values for `propertyName` for each element within `list`
|
||||
**/
|
||||
export function pluck<T extends {}>(
|
||||
list: Collection<T>,
|
||||
propertyName: string): T[];
|
||||
propertyName: string): any[];
|
||||
|
||||
/**
|
||||
* Returns the maximum value in list.
|
||||
@@ -2852,4 +2852,4 @@ interface _Chain<T> {
|
||||
|
||||
declare module "underscore" {
|
||||
export = _;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user