mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
added _.isArray definition
This commit is contained in:
@@ -570,6 +570,7 @@ result = <any>_.forInRight(new Dog('Dagny'), function(value, key) {
|
||||
console.log(key);
|
||||
});
|
||||
|
||||
|
||||
result = <any>_.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
|
||||
console.log(key);
|
||||
});
|
||||
@@ -587,6 +588,9 @@ result = <any>_.invert({ 'first': 'moe', 'second': 'larry' });
|
||||
|
||||
(function(...args: any[]) { return <boolean>_.isArguments(arguments); })(1, 2, 3);
|
||||
|
||||
(function () { return _.isArray(arguments); })();
|
||||
_.isArray([1, 2, 3]);
|
||||
|
||||
var mergeNames = {
|
||||
'stooges': [
|
||||
{ 'name': 'moe' },
|
||||
@@ -666,9 +670,6 @@ _.isEmpty({});
|
||||
|
||||
_.isElement($('body')[0]);
|
||||
|
||||
(function () { return _.isArray(arguments); })();
|
||||
_.isArray([1, 2, 3]);
|
||||
|
||||
_.isObject({});
|
||||
_.isObject(1);
|
||||
|
||||
|
||||
Vendored
+7
-7
@@ -2353,6 +2353,13 @@ declare module _ {
|
||||
**/
|
||||
export function isArguments(value: any): boolean;
|
||||
|
||||
/**
|
||||
* Checks if value is an array.
|
||||
* @param value The value to check.
|
||||
* @return True if the value is an array, else false.
|
||||
**/
|
||||
export function isArray(value: any): boolean;
|
||||
|
||||
/**
|
||||
* Recursively merges own enumerable properties of the source object(s), that don't resolve
|
||||
* to undefined into the destination object. Subsequent sources will overwrite property
|
||||
@@ -2589,13 +2596,6 @@ declare module _ {
|
||||
**/
|
||||
export function isElement(object: any): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if object is an Array.
|
||||
* @param object Check if this object is an Array.
|
||||
* @return True if `object` is an Array, otherwise false.
|
||||
**/
|
||||
export function isArray(object: any): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if value is an Object. Note that JavaScript arrays and functions are objects,
|
||||
* while (normal) strings and numbers are not.
|
||||
|
||||
Reference in New Issue
Block a user