From f569128818c2b4bb9a7f3e7243edf618f213eae1 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sat, 22 Aug 2015 14:38:19 +0500 Subject: [PATCH] lodash: changed _.isNumber() method --- lodash/lodash-tests.ts | 8 ++++++-- lodash/lodash.d.ts | 30 ++++++++++++++++++------------ 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 00ca144fd..860af6550 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1236,6 +1236,12 @@ result = _(undefined).isNaN(); result = _.isNative(Array.prototype.push); result = _(Array.prototype.push).isNative(); +// _.isNumber +result = _.isNumber(any); +result = _(1).isNumber(); +result = _([]).isNumber(); +result = _({}).isNumber(); + // _.isRegExp result = _.isRegExp(any); result = _(1).isRegExp(); @@ -1475,8 +1481,6 @@ result = _.isFunction(_); result = _.isNull(null); result = _.isNull(undefined); -result = _.isNumber(8.4 * 5); - result = _.isObject({}); result = _.isObject([1, 2, 3]); result = _.isObject(1); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 77daeca2a..b275a5b33 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -6277,6 +6277,24 @@ declare module _ { isNative(): boolean; } + //_.isNumber + interface LoDashStatic { + /** + * Checks if value is classified as a Number primitive or object. + * Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method. + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isNumber(value?: any): boolean; + } + + interface LoDashWrapperBase { + /** + * see _.isNumber + */ + isNumber(): boolean; + } + //_.isRegExp interface LoDashStatic { /** @@ -7110,18 +7128,6 @@ declare module _ { isNull(value?: any): boolean; } - //_.isNumber - interface LoDashStatic { - /** - * Checks if value is a number. - * - * Note: NaN is considered a number. See http://es5.github.io/#x8.5. - * @param value The value to check. - * @return True if the value is a number, else false. - **/ - isNumber(value?: any): boolean; - } - //_.isObject interface LoDashStatic { /**