Merge pull request #5794 from chrootsu/lodash-noConflict

lodash: changed _.noConflict() method
This commit is contained in:
Masahiro Wakame
2015-09-16 22:57:18 +09:00
2 changed files with 20 additions and 5 deletions
+9 -2
View File
@@ -1751,8 +1751,6 @@ var testAttempFn: TestAttemptFn;
result = <TResult|Error>_.attempt<TResult>(testAttempFn);
result = <TResult|Error>_(testAttempFn).attempt<TResult>();
var lodash = <typeof _>_.noConflict();
result = <number>_.random(0, 5);
result = <number>_.random(5);
result = <number>_.random(5, true);
@@ -2077,6 +2075,15 @@ result = <number>(_(TestMethodOfObject).methodOf<number>(1, 2).value())(['a', '0
result = _(testMixinSource).mixin<TResult>(testMixinOptions).value();
}
// _.noConflict
{
let result: typeof _;
result = _.noConflict();
result = _(42).noConflict();
result = _<any>([]).noConflict();
result = _({}).noConflict();
}
// _.uniqueId
result = <string>_.uniqueId();
result = <string>_.uniqueId('');
+11 -3
View File
@@ -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<T, TWrapper> {
/**
* @see _.noConflict
*/
noConflict(): typeof _;
}