From c4728ab3c3143905e153dbf7f013f16d642d4fe5 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Wed, 26 Aug 2015 06:15:32 +0500 Subject: [PATCH] lodash: changed _.isObject() method --- lodash/lodash-tests.ts | 10 ++++++---- lodash/lodash.d.ts | 29 ++++++++++++++++++----------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 45248b829c..aed7f9544a 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1284,6 +1284,12 @@ result = _(1).isNumber(); result = _([]).isNumber(); result = _({}).isNumber(); +// _.isObject +result = _.isObject(any); +result = _(1).isObject(); +result = _([]).isObject(); +result = _({}).isObject(); + // _.isPlainObject result = _.isPlainObject(any); result = _(1).isPlainObject(); @@ -1522,10 +1528,6 @@ result = _(testEqArray).isEqual(testEqOtherArray, testEqCustomizerFn); result = _.eq(testEqArray, testEqOtherArray, testEqCustomizerFn); result = _(testEqArray).eq(testEqOtherArray, testEqCustomizerFn); -result = _.isObject({}); -result = _.isObject([1, 2, 3]); -result = _.isObject(1); - class Stooge { constructor( public name: string, diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 92b621ab23..ea89b42397 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -6415,6 +6415,24 @@ declare module _ { isNumber(): boolean; } + //_.isObject + interface LoDashStatic { + /** + * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0), + * and new String('')) + * @param value The value to check. + * @return Returns true if value is an object, else false. + **/ + isObject(value?: any): boolean; + } + + interface LoDashWrapperBase { + /** + * see _.isObject + */ + isObject(): boolean; + } + //_.isPlainObject interface LoDashStatic { /** @@ -7215,17 +7233,6 @@ declare module _ { thisArg?: any): boolean; } - //_.isObject - interface LoDashStatic { - /** - * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, - * new Number(0), and new String('')) - * @param value The value to check. - * @return True if the value is an object, else false. - **/ - isObject(value?: any): boolean; - } - //_.keys interface LoDashStatic { /**