lodash: changed _.noop() method

This commit is contained in:
Ilya Mochalov
2015-08-13 21:47:27 +05:00
parent e95958ac84
commit b54cbbe7e0
2 changed files with 29 additions and 8 deletions
+13
View File
@@ -89,6 +89,8 @@ class Dog {
var result: any;
var any: any;
// _.MapCache
var testMapCache: _.MapCache;
result = <(key: string) => boolean>testMapCache.delete;
@@ -1462,6 +1464,17 @@ result = <number>_.random(5, true);
result = <number>_.random(1.2, 5.2);
result = <number>_.random(0, 5, true);
// _.noop
result = <void>_.noop();
result = <void>_.noop(1);
result = <void>_.noop('a', 1);
result = <void>_.noop(true, 'a', 1);
result = <void>_('a').noop(true, 'a', 1);
result = <void>_([1]).noop(true, 'a', 1);
result = <void>_<string>([]).noop(true, 'a', 1);
result = <void>_({}).noop(true, 'a', 1);
result = <void>_(any).noop(true, 'a', 1);
var object = {
'cheese': 'crumpets',
'stuff': function () {
+16 -8
View File
@@ -7299,6 +7299,22 @@ declare module _ {
noConflict(): typeof _;
}
//_.noop
interface LoDashStatic {
/**
* A no-operation function that returns undefined regardless of the arguments it receives.
* @return undefined
*/
noop(...args: any[]): void;
}
interface LoDashWrapperBase<T, TWrapper> {
/**
* @see _.noop
*/
noop(...args: any[]): void;
}
//_.property
interface LoDashStatic {
/**
@@ -7452,14 +7468,6 @@ declare module _ {
uniqueId(prefix?: string): string;
}
//_.noop
interface LoDashStatic {
/**
* A no-operation function.
**/
noop(): void;
}
//_.constant
interface LoDashStatic {
/**