Skip to content

Commit 0f25d7e

Browse files
committed
lodash: changed _.noConflict() method
1 parent 52b0ea5 commit 0f25d7e

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

lodash/lodash-tests.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,8 +1716,6 @@ var testAttempFn: TestAttemptFn;
17161716
result = <TResult|Error>_.attempt<TResult>(testAttempFn);
17171717
result = <TResult|Error>_(testAttempFn).attempt<TResult>();
17181718

1719-
var lodash = <typeof _>_.noConflict();
1720-
17211719
result = <number>_.random(0, 5);
17221720
result = <number>_.random(5);
17231721
result = <number>_.random(5, true);
@@ -2012,6 +2010,15 @@ result = <number>(_(TestMethodOfObject).methodOf<number>(1, 2).value())(['a', '0
20122010
result = _(testMixinSource).mixin<TResult>(testMixinOptions).value();
20132011
}
20142012

2013+
// _.noConflict
2014+
{
2015+
let result: typeof _;
2016+
result = _.noConflict();
2017+
result = _(42).noConflict();
2018+
result = _<any>([]).noConflict();
2019+
result = _({}).noConflict();
2020+
}
2021+
20152022
// _.uniqueId
20162023
result = <string>_.uniqueId();
20172024
result = <string>_.uniqueId('');

lodash/lodash.d.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8262,9 +8262,17 @@ declare module _ {
82628262
//_.noConflict
82638263
interface LoDashStatic {
82648264
/**
8265-
* Reverts the '_' variable to its previous value and returns a reference to the lodash function.
8266-
* @return The lodash function.
8267-
**/
8265+
* Reverts the _ variable to its previous value and returns a reference to the lodash function.
8266+
*
8267+
* @return Returns the lodash function.
8268+
*/
8269+
noConflict(): typeof _;
8270+
}
8271+
8272+
interface LoDashWrapperBase<T, TWrapper> {
8273+
/**
8274+
* @see _.noConflict
8275+
*/
82688276
noConflict(): typeof _;
82698277
}
82708278

0 commit comments

Comments
 (0)