lodash: changed _.isNumber() method

This commit is contained in:
Ilya Mochalov
2015-08-24 00:07:12 +05:00
parent af81415504
commit f569128818
2 changed files with 24 additions and 14 deletions
+6 -2
View File
@@ -1236,6 +1236,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();
@@ -1475,8 +1481,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);
+18 -12
View File
@@ -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<T, TWrapper> {
/**
* 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 {
/**