Y
Hacker News
new
|
ask
|
show
|
jobs
by
ivanjermakov
98 days ago
That's intentional, TS types are erased in runtime. My go-to way for this is discriminated unions:
https://www.typescriptlang.org/docs/handbook/unions-and-inte...