diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 8ffb263ef..fe5a8a057 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1242,6 +1242,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(); @@ -1479,8 +1485,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 2ba77aefb..cf5717666 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -6294,6 +6294,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 { /** @@ -7117,18 +7135,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 { /**