mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
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`);
}
|
||
|---|---|---|
| .. | ||
| index.d.ts | ||
| is-number-tests.ts | ||
| tsconfig.json | ||
| tslint.json | ||