Skip to content

Commit 6d7539a

Browse files
authored
Fix Number.is* to accept unknown again (microsoft#34932)
Fixes microsoft#34931 This essentially reapplies microsoft#24436 which incorrectly updated the generated files rather than the sources, and so was wiped out by 2f73986. Note that this is specifically _not_ the same as microsoft#4002, which pertains to the global functions that coerce their arguments and therefore should _not_ accept `unknown`. This change was already accepted 18 months ago, but was applied incorrectly.
1 parent 3c130d1 commit 6d7539a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/es2015.core.d.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -213,27 +213,27 @@ interface NumberConstructor {
213213
* number. Only finite values of the type number, result in true.
214214
* @param number A numeric value.
215215
*/
216-
isFinite(number: number): boolean;
216+
isFinite(number: unknown): boolean;
217217

218218
/**
219219
* Returns true if the value passed is an integer, false otherwise.
220220
* @param number A numeric value.
221221
*/
222-
isInteger(number: number): boolean;
222+
isInteger(number: unknown): boolean;
223223

224224
/**
225225
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
226226
* number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
227227
* to a number. Only values of the type number, that are also NaN, result in true.
228228
* @param number A numeric value.
229229
*/
230-
isNaN(number: number): boolean;
230+
isNaN(number: unknown): boolean;
231231

232232
/**
233233
* Returns true if the value passed is a safe integer.
234234
* @param number A numeric value.
235235
*/
236-
isSafeInteger(number: number): boolean;
236+
isSafeInteger(number: unknown): boolean;
237237

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

0 commit comments

Comments
 (0)