From 6153dcb3010d9661fe2e038d91ae440859b5364c Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sun, 29 Nov 2015 07:38:27 +0500 Subject: [PATCH] lodash: signatures of _.invert have been changed --- lodash/lodash-tests.ts | 30 ++++++++++++++++++++++++------ lodash/lodash.d.ts | 20 +++++++++++++++++++- 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index bdc08ccdc7..3563bc9907 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -6399,12 +6399,30 @@ module TestHas { } // _.invert -{ - let result: TResult; - result = _.invert({}); - result = _.invert({}, true); - result = _({}).invert().value(); - result = _({}).invert(true).value(); +module TestInvert { + { + let result: TResult; + + result = _.invert({}); + result = _.invert({}, true); + + result = _.invert({}); + result = _.invert({}, true); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _({}).invert(); + result = _({}).invert(true); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _({}).chain().invert(); + result = _({}).chain().invert(true); + } } // _.keys diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index ad465c5c39..dd266bba7a 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -10823,7 +10823,18 @@ declare module _ { * @param multiValue Allow multiple values per key. * @return Returns the new inverted object. */ - invert(object: T, multiValue?: boolean): TResult; + invert( + object: T, + multiValue?: boolean + ): TResult; + + /** + * @see _.invert + */ + invert( + object: Object, + multiValue?: boolean + ): TResult; } interface LoDashImplicitObjectWrapper { @@ -10833,6 +10844,13 @@ declare module _ { invert(multiValue?: boolean): LoDashImplicitObjectWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.invert + */ + invert(multiValue?: boolean): LoDashExplicitObjectWrapper; + } + //_.keys interface LoDashStatic { /**