mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #5806 from chrootsu/lodash-runInContext
lodash: changed _.runInContext() method
This commit is contained in:
@@ -1887,9 +1887,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: {
|
||||
@@ -2203,6 +2200,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('');
|
||||
|
||||
Vendored
+13
-5
@@ -8568,11 +8568,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
|
||||
|
||||
Reference in New Issue
Block a user