lodash: changed _.runInContext() method

This commit is contained in:
Ilya Mochalov
2015-09-16 19:58:45 +05:00
parent 5f48028783
commit 8c900f86c7
2 changed files with 21 additions and 8 deletions
+8 -3
View File
@@ -1768,9 +1768,6 @@ result = <void>_<string>([]).noop(true, 'a', 1);
result = <void>_({}).noop(true, 'a', 1);
result = <void>_(any).noop(true, 'a', 1);
var tempObject = {};
result = <typeof _>_.runInContext(tempObject);
// _.property
interface TestPropertyObject {
a: {
@@ -2084,6 +2081,14 @@ result = <number>(_(TestMethodOfObject).methodOf<number>(1, 2).value())(['a', '0
result = _({}).noConflict();
}
// _.runInContext
{
let result: typeof _;
result = _.runInContext();
result = _.runInContext({});
result = _({}).runInContext();
}
// _.uniqueId
result = <string>_.uniqueId();
result = <string>_.uniqueId('');
+13 -5
View File
@@ -8552,11 +8552,19 @@ declare module _ {
//_.runInContext
interface LoDashStatic {
/**
* Create a new lodash function using the given context object.
* @param context The context object
* @returns The lodash function.
**/
runInContext(context: any): typeof _;
* Create a new pristine lodash function using the given context object.
*
* @param context The context object.
* @return Returns a new lodash function.
*/
runInContext(context?: Object): typeof _;
}
interface LoDashObjectWrapper<T> {
/**
* @see _.runInContext
*/
runInContext(): typeof _;
}
//_.times