mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-29 01:45:49 +08:00
Merge pull request #5492 from chrootsu/lodash-isNumber
lodash: changed _.isNumber() method
This commit is contained in:
@@ -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
30
lodash/lodash.d.ts
vendored
@@ -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 {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user