From a42f8cb453c7cc7b96c175099cfe742272fd2db9 Mon Sep 17 00:00:00 2001 From: Brian Zengel Date: Sun, 20 Oct 2013 16:48:12 -0400 Subject: [PATCH] added _.isNumber definition --- lodash/lodash-tests.ts | 2 ++ lodash/lodash.d.ts | 16 +++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index da2302b0a..c8c128eb4 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -632,6 +632,8 @@ result = _.isNaN(undefined); result = _.isNull(null); result = _.isNull(undefined); +result = _.isNumber(8.4 * 5); + var mergeNames = { 'stooges': [ { 'name': 'moe' }, diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 5ae120b8d..c45939d70 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2450,6 +2450,15 @@ declare module _ { **/ export function isNull(value: any): boolean; + /** + * 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. + **/ + export function isNumber(value: any): boolean; + /** * Recursively merges own enumerable properties of the source object(s), that don't resolve * to undefined into the destination object. Subsequent sources will overwrite property @@ -2684,13 +2693,6 @@ declare module _ { **/ export function isString(object: any): boolean; - /** - * Returns true if object is a Number (including NaN). - * @param object Check if this object is a Number. - * @return True if `object` is a Number, otherwise false. - **/ - export function isNumber(object: any): boolean; - /** * Returns true if object is a RegExp. * @param object Check if this object is a RegExp.