mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-11 22:37:31 +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:
6
underscore/underscore.d.ts
vendored
6
underscore/underscore.d.ts
vendored
@@ -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