diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 7173cc10a0..48f69210df 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -6536,12 +6536,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 f92a1e4f88..49de3691e2 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -10949,7 +10949,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 { @@ -10959,6 +10970,13 @@ declare module _ { invert(multiValue?: boolean): LoDashImplicitObjectWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.invert + */ + invert(multiValue?: boolean): LoDashExplicitObjectWrapper; + } + //_.keys interface LoDashStatic { /**