From 3dd95fd744a97fcd12a7bb58386068040259c1ba Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sat, 24 Oct 2015 23:52:26 +0500 Subject: [PATCH] lodash: signatures of the method _.mixin changed --- lodash/lodash-tests.ts | 42 ++++++++++++++++++++++++++++++------------ lodash/lodash.d.ts | 17 +++++++++++++++++ 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index c083edd4cf..4958c92c33 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -3812,18 +3812,36 @@ result = (_(TestMethodOfObject).methodOf(1, 2).value())('a[0]'); result = (_(TestMethodOfObject).methodOf(1, 2).value())(['a', '0']); // _.mixin -{ - let testMixinSource: _.Dictionary; - let testMixinOptions: {chain?: boolean;} - let result: TResult; - result = _.mixin({}, testMixinSource); - result = _.mixin({}, testMixinSource, testMixinOptions); - result = _.mixin(testMixinSource); - result = _.mixin(testMixinSource, testMixinOptions); - result = _({}).mixin(testMixinSource).value(); - result = _({}).mixin(testMixinSource, testMixinOptions).value(); - result = _(testMixinSource).mixin().value(); - result = _(testMixinSource).mixin(testMixinOptions).value(); +module TestMixin { + let source: _.Dictionary; + let options: {chain?: boolean}; + + { + let result: TResult; + + result = _.mixin({}, source); + result = _.mixin({}, source, options); + result = _.mixin(source); + result = _.mixin(source, options); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _({}).mixin(source); + result = _({}).mixin(source, options); + result = _(source).mixin(); + result = _(source).mixin(options); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _({}).chain().mixin(source); + result = _({}).chain().mixin(source, options); + result = _(source).chain().mixin(); + result = _(source).chain().mixin(options); + } } // _.noConflict diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 8811243289..84454acb0b 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -9739,6 +9739,23 @@ declare module _ { ): LoDashImplicitObjectWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.mixin + */ + mixin( + source: Dictionary, + options?: MixinOptions + ): LoDashExplicitObjectWrapper; + + /** + * @see _.mixin + */ + mixin( + options?: MixinOptions + ): LoDashExplicitObjectWrapper; + } + //_.noConflict interface LoDashStatic { /**