mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-13 22:40:50 +08:00
Merge pull request #16492 from olamothe/master
Modified underscore _.pairs definition in chaining mode.
This commit is contained in:
2
types/underscore/index.d.ts
vendored
2
types/underscore/index.d.ts
vendored
@@ -5689,7 +5689,7 @@ declare module _ {
|
||||
* Wrapped type `object`.
|
||||
* @see _.pairs
|
||||
**/
|
||||
pairs(): _Chain<T>;
|
||||
pairs(): _Chain<T[]>;
|
||||
|
||||
/**
|
||||
* Wrapped type `object`.
|
||||
|
||||
@@ -520,6 +520,11 @@ function chain_tests() {
|
||||
.groupBy('property')
|
||||
.mapObject((objects: any) => _.pluck(objects, 'value'))
|
||||
.value(); // { odd: [1], even: [0, 2] }
|
||||
|
||||
var matrixOfString : string[][] = _.chain({'foo' : '1', 'bar': '1'})
|
||||
.keys() // return ['foo', 'bar'] : string[]
|
||||
.pairs() // return [['foo', '0'], ['bar', '1']] : string[][]
|
||||
.value();
|
||||
}
|
||||
|
||||
var obj: { [k: string] : number } = {
|
||||
|
||||
Reference in New Issue
Block a user