added _.isArray definition

This commit is contained in:
Brian Zengel
2013-10-20 13:07:58 -04:00
parent a98537ef05
commit 8895133208
2 changed files with 11 additions and 10 deletions
+4 -3
View File
@@ -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);
+7 -7
View File
@@ -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.