Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: