Merge pull request #16492 from olamothe/master

Modified underscore _.pairs definition in chaining mode.
This commit is contained in:
Nathan Shively-Sanders
2017-06-01 14:16:27 -07:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -5689,7 +5689,7 @@ declare module _ {
* Wrapped type `object`.
* @see _.pairs
**/
pairs(): _Chain<T>;
pairs(): _Chain<T[]>;
/**
* Wrapped type `object`.

View File

@@ -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 } = {