From 8895133208b90d1bf5829003da9997f8fc3b6c28 Mon Sep 17 00:00:00 2001 From: Brian Zengel Date: Sun, 20 Oct 2013 13:07:58 -0400 Subject: [PATCH] added _.isArray definition --- lodash/lodash-tests.ts | 7 ++++--- lodash/lodash.d.ts | 14 +++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index ed886070d..1d5881056 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -570,6 +570,7 @@ result = _.forInRight(new Dog('Dagny'), function(value, key) { console.log(key); }); + result = _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { console.log(key); }); @@ -587,6 +588,9 @@ result = _.invert({ 'first': 'moe', 'second': 'larry' }); (function(...args: any[]) { return _.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); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index bb3eb9655..5ec14ad94 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -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.