From 4d2ad3d1b3a5b8890d68ab370ad78dbaf723d914 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Wed, 19 Aug 2015 05:40:51 +0500 Subject: [PATCH] lodash: changed _.isArray() method --- lodash/lodash-tests.ts | 9 ++++++--- lodash/lodash.d.ts | 27 +++++++++++++++++---------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 2cbec6853..a3728d7f2 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1139,6 +1139,12 @@ result = _(1).gte(2); result = _([]).gte(2); result = _({}).gte(2); +// _.isArray +result = _.isArray(any); +result = _(1).isArray(); +result = _([]).isArray(); +result = _({}).isArray(); + // _.isEmpty result = _.isEmpty([1, 2, 3]); result = _.isEmpty({}); @@ -1365,9 +1371,6 @@ result = _.invert({ 'first': 'moe', 'second': 'larry' }); (function (...args: any[]) { return _.isArguments(arguments); })(1, 2, 3); -(function () { return _.isArray(arguments); })(); -result = _.isArray([1, 2, 3]); - result = _.isBoolean(null); result = _.isDate(new Date()); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index c088f5459..61c99b913 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -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 { + /** + * @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 { /**