From 87c59a50dbd875db0ed3a9676cf72bd0f25e9515 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sat, 15 Aug 2015 23:05:59 +0500 Subject: [PATCH] lodash: changed _.isNaN() method --- lodash/lodash-tests.ts | 12 ++++++++---- lodash/lodash.d.ts | 31 ++++++++++++++++++------------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 9d87e2a37..55f280a67 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1071,6 +1071,14 @@ result = _({}).isMatch({}); result = _({}).isMatch({}, testIsMatchCustiomizerFn); result = _({}).isMatch({}, testIsMatchCustiomizerFn, {}); +// _.isNaN +result = _.isNaN(NaN); +result = _.isNaN(new Number(NaN)); +result = _.isNaN(undefined); +result = _(NaN).isNaN(); +result = _(new Number(NaN)).isNaN(); +result = _(undefined).isNaN(); + // _.isNative result = _.isNative(Array.prototype.push); result = _(Array.prototype.push).isNative(); @@ -1309,10 +1317,6 @@ result = _.isFinite(Infinity); result = _.isFunction(_); -result = _.isNaN(NaN); -result = _.isNaN(new Number(NaN)); -result = _.isNaN(undefined); - result = _.isNull(null); result = _.isNull(undefined); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index b2603ee95..107f33741 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -5888,6 +5888,24 @@ declare module _ { isMatch(source: Object, customizer?: isMatchCustomizer, thisArg?: any): boolean; } + //_.isNaN + interface LoDashStatic { + /** + * Checks if value is NaN. + * Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values. + * @param value The value to check. + * @return Returns true if value is NaN, else false. + */ + isNaN(value?: any): boolean; + } + + interface LoDashWrapperBase { + /** + * @see _.isNaN + */ + isNaN(): boolean; + } + //_.isNative interface LoDashStatic { /** @@ -6719,19 +6737,6 @@ declare module _ { isFunction(value?: any): boolean; } - //_.isNaN - interface LoDashStatic { - /** - * Checks if value is NaN. - * - * Note: This is not the same as native isNaN which will return true for undefined and other - * non-numeric values. See http://es5.github.io/#x15.1.2.4. - * @param value The value to check. - * @return True if the value is NaN, else false. - **/ - isNaN(value?: any): boolean; - } - //_.isNull interface LoDashStatic { /**