lodash: changed _.isArray() method

This commit is contained in:
Ilya Mochalov
2015-08-20 01:08:35 +05:00
parent bb45306d0f
commit 4d2ad3d1b3
2 changed files with 23 additions and 13 deletions
+6 -3
View File
@@ -1139,6 +1139,12 @@ result = <boolean>_(1).gte(2);
result = <boolean>_([]).gte(2);
result = <boolean>_({}).gte(2);
// _.isArray
result = <boolean>_.isArray(any);
result = <boolean>_(1).isArray();
result = <boolean>_<any>([]).isArray();
result = <boolean>_({}).isArray();
// _.isEmpty
result = <boolean>_.isEmpty([1, 2, 3]);
result = <boolean>_.isEmpty({});
@@ -1365,9 +1371,6 @@ result = <FirstSecond>_.invert({ 'first': 'moe', 'second': 'larry' });
(function (...args: any[]) { return <boolean>_.isArguments(arguments); })(1, 2, 3);
(function () { return <boolean>_.isArray(arguments); })();
result = <boolean>_.isArray([1, 2, 3]);
result = <boolean>_.isBoolean(null);
result = <boolean>_.isDate(new Date());
+17 -10
View File
@@ -6080,6 +6080,23 @@ declare module _ {
gte(other: any): boolean;
}
//_.isArray
interface LoDashStatic {
/**
* Checks if value is classified as an Array object.
* @param value The value to check.
* @return Returns true if value is correctly classified, else false.
**/
isArray(value?: any): boolean;
}
interface LoDashWrapperBase<T,TWrapper> {
/**
* @see _.isArray
*/
isArray(): boolean;
}
//_.isEmpty
interface LoDashStatic {
/**
@@ -6839,16 +6856,6 @@ declare module _ {
isArguments(value?: any): boolean;
}
//_.isArray
interface LoDashStatic {
/**
* Checks if value is an array.
* @param value The value to check.
* @return True if the value is an array, else false.
**/
isArray(value?: any): boolean;
}
//_.isBoolean
interface LoDashStatic {
/**