mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
🤖 Merge PR #46919 [is-number] Changed return type of isNumber to boolean by @hettlage
The previous return type gave an error ("Property 'split' does not exist on type 'never'. TS2339") when the following code is compiled with TypeScript 3.9.7:
const s = "13:09:42";
if (isNumber(s)) {
console.log(`${s} hours`);
} else {
const hours = s.split(":");
console.log(`${hours} hours`);
}
This commit is contained in:
parent
679571bbfc
commit
4d4da2106d
2
types/is-number/index.d.ts
vendored
2
types/is-number/index.d.ts
vendored
@ -11,4 +11,4 @@ export = is_number;
|
||||
* @param num Any value that should be tested for being a number
|
||||
* @returns true if the parameter is a valid number, otherwise false
|
||||
*/
|
||||
declare function is_number(num: any): num is number | string;
|
||||
declare function is_number(num: any): boolean;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user