TypeScript only provides the illusion of type safety. At runtime, it’s just plain old JS where all bets are off. I’ve been bitten too many times. As long as there’s no native TS runtime were stuck pretending we have type safety.

Happened to me This helps me with it at the cost of a little bit more lines of code https://github.com/gcanti/io-ts