From 701ad3fcc01782b5c366f5b507a2ee4fcb6a57ec Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Fri, 24 Mar 2017 13:53:25 -0400 Subject: [PATCH] lodash: fix toPairs, toPairsIn definitions toPairs: https://github.com/lodash/lodash/blob/4.17.4/lodash.js#L13684:L13708 toPairsIn: https://github.com/lodash/lodash/blob/4.17.4/lodash.js#L13710:L13734 Fixes #14654. --- types/lodash/index.d.ts | 16 ++++++++-------- types/lodash/lodash-tests.ts | 24 ++++++++++++------------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/types/lodash/index.d.ts b/types/lodash/index.d.ts index 6326773899..79326724b1 100644 --- a/types/lodash/index.d.ts +++ b/types/lodash/index.d.ts @@ -16993,23 +16993,23 @@ declare namespace _ { * @param object The object to query. * @return Returns the new array of key-value pairs. */ - toPairs(object?: T): any[][]; + toPairs(object?: T): [string, any][]; - toPairs(object?: T): TResult[][]; + toPairs(object?: T): [string, TResult][]; } interface LoDashImplicitObjectWrapper { /** * @see _.toPairs */ - toPairs(): LoDashImplicitArrayWrapper; + toPairs(): LoDashImplicitArrayWrapper<[string, TResult]>; } interface LoDashExplicitObjectWrapper { /** * @see _.toPairs */ - toPairs(): LoDashExplicitArrayWrapper; + toPairs(): LoDashExplicitArrayWrapper<[string, TResult]>; } //_.toPairsIn @@ -17020,23 +17020,23 @@ declare namespace _ { * @param object The object to query. * @return Returns the new array of key-value pairs. */ - toPairsIn(object?: T): any[][]; + toPairsIn(object?: T): [string, any][]; - toPairsIn(object?: T): TResult[][]; + toPairsIn(object?: T): [string, TResult][]; } interface LoDashImplicitObjectWrapper { /** * @see _.toPairsIn */ - toPairsIn(): LoDashImplicitArrayWrapper; + toPairsIn(): LoDashImplicitArrayWrapper<[string, TResult]>; } interface LoDashExplicitObjectWrapper { /** * @see _.toPairsIn */ - toPairsIn(): LoDashExplicitArrayWrapper; + toPairsIn(): LoDashExplicitArrayWrapper<[string, TResult]>; } //_.transform diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index b260df8ee5..8659859557 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -10176,37 +10176,37 @@ namespace TestToPairs { let object: _.Dictionary; { - let result: any[][]; + let result: [string, any][]; result = _.toPairs<_.Dictionary>(object); } { - let result: string[][]; + let result: [string, string][]; result = _.toPairs<_.Dictionary, string>(object); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper<[string, string]>; result = _(object).toPairs(); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper<[string, any]>; result = _(object).toPairs(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper<[string, string]>; result = _(object).chain().toPairs(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper<[string, any]>; result = _(object).chain().toPairs(); } @@ -10217,37 +10217,37 @@ namespace TestToPairsIn { let object: _.Dictionary; { - let result: any[][]; + let result: [string, any][]; result = _.toPairsIn<_.Dictionary>(object); } { - let result: string[][]; + let result: [string, string][]; result = _.toPairsIn<_.Dictionary, string>(object); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper<[string, string]>; result = _(object).toPairsIn(); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper<[string, any]>; result = _(object).toPairsIn(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper<[string, string]>; result = _(object).chain().toPairsIn(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper<[string, any]>; result = _(object).chain().toPairs(); }