Merge pull request #5492 from chrootsu/lodash-isNumber

lodash: changed _.isNumber() method
This commit is contained in:
Masahiro Wakame
2015-08-26 00:57:12 +09:00
2 changed files with 24 additions and 14 deletions

View File

@@ -1242,6 +1242,12 @@ result = <boolean>_(undefined).isNaN();
result = <boolean>_.isNative(Array.prototype.push);
result = <boolean>_(Array.prototype.push).isNative();
// _.isNumber
result = <boolean>_.isNumber(any);
result = <boolean>_(1).isNumber();
result = <boolean>_<any>([]).isNumber();
result = <boolean>_({}).isNumber();
// _.isRegExp
result = <boolean>_.isRegExp(any);
result = <boolean>_(1).isRegExp();
@@ -1479,8 +1485,6 @@ result = <boolean>_.isFunction(_);
result = <boolean>_.isNull(null);
result = <boolean>_.isNull(undefined);
result = <boolean>_.isNumber(8.4 * 5);
result = <boolean>_.isObject({});
result = <boolean>_.isObject([1, 2, 3]);
result = <boolean>_.isObject(1);

30
lodash/lodash.d.ts vendored
View File

@@ -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<T, TWrapper> {
/**
* 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 {
/**