diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 2cbec6853..c2f0b3f2d 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1147,6 +1147,12 @@ result = _([1, 2, 3]).isEmpty(); result = _({}).isEmpty(); result = _('').isEmpty(); +// _.isFinite +result = _.isFinite(any); +result = _(1).isFinite(); +result = _([]).isFinite(); +result = _({}).isFinite(); + // _.isMatch var testIsMatchCustiomizerFn: (value: any, other: any, indexOrKey: number|string) => boolean; result = _.isMatch({}, {}); @@ -1399,12 +1405,6 @@ result = _(testEqArray).isEqual(testEqOtherArray, testEqCustomizerFn); result = _.eq(testEqArray, testEqOtherArray, testEqCustomizerFn); result = _(testEqArray).eq(testEqOtherArray, testEqCustomizerFn); -result = _.isFinite(-101); -result = _.isFinite('10'); -result = _.isFinite(true); -result = _.isFinite(''); -result = _.isFinite(Infinity); - result = _.isFunction(_); result = _.isNull(null); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index c088f5459..9e4834df8 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -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 { + /** + * @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 { /**