diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 988f7a59e..fc36241c5 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1751,8 +1751,6 @@ var testAttempFn: TestAttemptFn; result = _.attempt(testAttempFn); result = _(testAttempFn).attempt(); -var lodash = _.noConflict(); - result = _.random(0, 5); result = _.random(5); result = _.random(5, true); @@ -2077,6 +2075,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 b5c363ee0..db2405580 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -8424,9 +8424,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 _; }