From e47ef31f9b1e46596a50ff5342d58f2fcf3203a0 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Mon, 24 Aug 2015 00:37:36 +0500 Subject: [PATCH] lodash: changed _.isFunction() method --- lodash/lodash-tests.ts | 8 ++++++-- lodash/lodash.d.ts | 27 +++++++++++++++++---------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 00ca144fd..544529d01 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1215,6 +1215,12 @@ result = _(1).isFinite(); result = _([]).isFinite(); result = _({}).isFinite(); +// _.isFunction +result = _.isFunction(any); +result = _(1).isFunction(); +result = _([]).isFunction(); +result = _({}).isFunction(); + // _.isMatch var testIsMatchCustiomizerFn: (value: any, other: any, indexOrKey: number|string) => boolean; result = _.isMatch({}, {}); @@ -1470,8 +1476,6 @@ result = _(testEqArray).isEqual(testEqOtherArray, testEqCustomizerFn); result = _.eq(testEqArray, testEqOtherArray, testEqCustomizerFn); result = _(testEqArray).eq(testEqOtherArray, testEqCustomizerFn); -result = _.isFunction(_); - result = _.isNull(null); result = _.isNull(undefined); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 77daeca2a..d5b6707f8 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -6215,6 +6215,23 @@ declare module _ { isFinite(): boolean; } + //_.isFunction + interface LoDashStatic { + /** + * Checks if value is classified as a Function object. + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + **/ + isFunction(value?: any): boolean; + } + + interface LoDashWrapperBase { + /** + * @see _.isFunction + */ + isFunction(): boolean; + } + //_.isMatch interface isMatchCustomizer { (value: any, other: any, indexOrKey?: number|string): boolean; @@ -7090,16 +7107,6 @@ declare module _ { thisArg?: any): boolean; } - //_.isFunction - interface LoDashStatic { - /** - * Checks if value is a function. - * @param value The value to check. - * @return True if the value is a function, else false. - **/ - isFunction(value?: any): boolean; - } - //_.isNull interface LoDashStatic { /**