4 ms·
The problem in your example isn't TypeScript. It's the JSON parser. If you used GSON in Java, you'd get the same result, despite being statically typed with run
by winrid 6y ago
The problem in your example isn't TypeScript. It's the JSON parser. If you used GSON in Java, you'd get the same result, despite being statically typed with runtime type checks.
You can implement the JSON parser to be type safe. For example, this is how nest-dto can prevent this.