From 0f25d7ef2851c07a8dea50022416a973e40a8f4b Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sun, 13 Sep 2015 01:34:51 +0500 Subject: [PATCH] lodash: changed _.noConflict() method --- lodash/lodash-tests.ts | 11 +++++++++-- lodash/lodash.d.ts | 14 +++++++++++--- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 5b9add244..9df4ce240 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1716,8 +1716,6 @@ var testAttempFn: TestAttemptFn; result = _.attempt(testAttempFn); result = _(testAttempFn).attempt(); -var lodash = _.noConflict(); - result = _.random(0, 5); result = _.random(5); result = _.random(5, true); @@ -2012,6 +2010,15 @@ result = (_(TestMethodOfObject).methodOf(1, 2).value())(['a', '0 result = _(testMixinSource).mixin(testMixinOptions).value(); } +// _.noConflict +{ + let result: typeof _; + result = _.noConflict(); + result = _(42).noConflict(); + result = _([]).noConflict(); + result = _({}).noConflict(); +} + // _.uniqueId result = _.uniqueId(); result = _.uniqueId(''); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index b6c95710b..a0f1ee47b 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -8262,9 +8262,17 @@ declare module _ { //_.noConflict interface LoDashStatic { /** - * Reverts the '_' variable to its previous value and returns a reference to the lodash function. - * @return The lodash function. - **/ + * Reverts the _ variable to its previous value and returns a reference to the lodash function. + * + * @return Returns the lodash function. + */ + noConflict(): typeof _; + } + + interface LoDashWrapperBase { + /** + * @see _.noConflict + */ noConflict(): typeof _; }