From 88b5e8747b100e295508f06595edb81f49125681 Mon Sep 17 00:00:00 2001 From: olamothe Date: Fri, 12 May 2017 11:02:04 -0400 Subject: [PATCH 1/3] _.pairs in chaining mode should return T[] instead of T --- types/underscore/index.d.ts | 2 +- types/underscore/underscore-tests.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/underscore/index.d.ts b/types/underscore/index.d.ts index 856bf8e0fa..eb8fdb57e0 100644 --- a/types/underscore/index.d.ts +++ b/types/underscore/index.d.ts @@ -5689,7 +5689,7 @@ declare module _ { * Wrapped type `object`. * @see _.pairs **/ - pairs(): _Chain; + pairs(): _Chain; /** * Wrapped type `object`. diff --git a/types/underscore/underscore-tests.ts b/types/underscore/underscore-tests.ts index 9953540fa8..6a423355e2 100644 --- a/types/underscore/underscore-tests.ts +++ b/types/underscore/underscore-tests.ts @@ -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 } = { From b1411b43c807c4ac2054bcbae8ac058264bc89ad Mon Sep 17 00:00:00 2001 From: olamothe Date: Fri, 12 May 2017 11:05:41 -0400 Subject: [PATCH 2/3] Alignment --- types/underscore/underscore-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/underscore/underscore-tests.ts b/types/underscore/underscore-tests.ts index 6a423355e2..047c367769 100644 --- a/types/underscore/underscore-tests.ts +++ b/types/underscore/underscore-tests.ts @@ -522,9 +522,9 @@ function chain_tests() { .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(); + .keys() // return ['foo', 'bar'] : string[] + .pairs() // return [['foo', '0'], ['bar', '1']] : string[][] + .value(); } var obj: { [k: string] : number } = { From a85e080d33c12ff87269fc5aa71a3427e09c6cbc Mon Sep 17 00:00:00 2001 From: Olivier Lamothe Date: Fri, 12 May 2017 11:08:37 -0400 Subject: [PATCH 3/3] Update test --- types/underscore/underscore-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/underscore/underscore-tests.ts b/types/underscore/underscore-tests.ts index 047c367769..11dcf477a0 100644 --- a/types/underscore/underscore-tests.ts +++ b/types/underscore/underscore-tests.ts @@ -522,7 +522,7 @@ function chain_tests() { .value(); // { odd: [1], even: [0, 2] } var matrixOfString : string[][] = _.chain({'foo' : '1', 'bar': '1'}) - .keys() // return ['foo', 'bar'] : string[] + .keys() // return ['foo', 'bar'] : string[] .pairs() // return [['foo', '0'], ['bar', '1']] : string[][] .value(); }