Comment by rtpg
8 days ago
The thing you gotta make sure to do is basically return inside of switch statements. Typescript will gladly propagate a type that you think is never but is actually ThatOneCaseYouForgot if it's not ever used or referred to.
Every TS project I've worked on has an assertNever(val) thing specifically to check for this kinda stuff
No comments yet
Contribute on Hacker News ↗