Skip to content

Commit a846e7f

Browse files
authored
Fixes Number.is* signatures to accept any input.
These functions are incredibly useful for testing to see if a value is a number that meets certain constraints as they return false for _any_ input that doesn't satisfy the constraints explicitly. Tested in NodeJS and Firefox and both of them work properly when you give a range of values. MDN also indicates that they will return false for any non-number input.
1 parent 927343c commit a846e7f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/lib.es2015.core.d.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -222,29 +222,29 @@ interface NumberConstructor {
222222
* Returns true if passed value is finite.
223223
* Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a
224224
* number. Only finite values of the type number, result in true.
225-
* @param number A numeric value.
225+
* @param value The value you want to test.
226226
*/
227-
isFinite(number: number): boolean;
227+
isFinite(value: any): boolean;
228228

229229
/**
230230
* Returns true if the value passed is an integer, false otherwise.
231-
* @param number A numeric value.
231+
* @param value The value you want to test.
232232
*/
233-
isInteger(number: number): boolean;
233+
isInteger(value: any): boolean;
234234

235235
/**
236236
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
237237
* number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
238238
* to a number. Only values of the type number, that are also NaN, result in true.
239-
* @param number A numeric value.
239+
* @param value The value you want to test.
240240
*/
241-
isNaN(number: number): boolean;
241+
isNaN(number: any): boolean;
242242

243243
/**
244244
* Returns true if the value passed is a safe integer.
245-
* @param number A numeric value.
245+
* @param value The value you want to test
246246
*/
247-
isSafeInteger(number: number): boolean;
247+
isSafeInteger(value: any): boolean;
248248

249249
/**
250250
* The value of the largest integer n such that n and n + 1 are both exactly representable as

0 commit comments

Comments
 (0)