lodash: changed _.isFinite() method

This commit is contained in:
Ilya Mochalov
2015-08-20 01:38:54 +05:00
parent bb45306d0f
commit 496f751d45
2 changed files with 24 additions and 19 deletions
+6 -6
View File
@@ -1147,6 +1147,12 @@ result = <boolean>_([1, 2, 3]).isEmpty();
result = <boolean>_({}).isEmpty();
result = <boolean>_('').isEmpty();
// _.isFinite
result = <boolean>_.isFinite(any);
result = <boolean>_(1).isFinite();
result = <boolean>_<any>([]).isFinite();
result = <boolean>_({}).isFinite();
// _.isMatch
var testIsMatchCustiomizerFn: (value: any, other: any, indexOrKey: number|string) => boolean;
result = <boolean>_.isMatch({}, {});
@@ -1399,12 +1405,6 @@ result = <boolean>_(testEqArray).isEqual(testEqOtherArray, testEqCustomizerFn);
result = <boolean>_.eq(testEqArray, testEqOtherArray, testEqCustomizerFn);
result = <boolean>_(testEqArray).eq(testEqOtherArray, testEqCustomizerFn);
result = <boolean>_.isFinite(-101);
result = <boolean>_.isFinite('10');
result = <boolean>_.isFinite(true);
result = <boolean>_.isFinite('');
result = <boolean>_.isFinite(Infinity);
result = <boolean>_.isFunction(_);
result = <boolean>_.isNull(null);
+18 -13
View File
@@ -6098,6 +6098,24 @@ declare module _ {
isEmpty(): boolean;
}
//_.isFinite
interface LoDashStatic {
/**
* Checks if value is a finite primitive number.
* Note: This method is based on Number.isFinite.
* @param value The value to check.
* @return Returns true if value is a finite number, else false.
**/
isFinite(value?: any): boolean;
}
interface LoDashWrapperBase<T, TWrapper> {
/**
* @see _.isFinite
*/
isFinite(): boolean;
}
//_.isMatch
interface isMatchCustomizer {
(value: any, other: any, indexOrKey?: number|string): boolean;
@@ -6970,19 +6988,6 @@ declare module _ {
thisArg?: any): boolean;
}
//_.isFinite
interface LoDashStatic {
/**
* Checks if value is, or can be coerced to, a finite number.
*
* Note: This is not the same as native isFinite which will return true for booleans and empty
* strings. See http://es5.github.io/#x15.1.2.5.
* @param value The value to check.
* @return True if the value is finite, else false.
**/
isFinite(value?: any): boolean;
}
//_.isFunction
interface LoDashStatic {
/**