4 ms·
I do not know of a way to make this a compiler error: const user: User = JSON.parse(…);
by hermanradtke 5y ago
I do not know of a way to make this a compiler error:
const user: User = JSON.parse(…);
- dhucerbin 5y agoYou can redefine all definitions from lib.d.ts and similar. In my projects, parse function returns unknown, so I need to parse/validate/decode it in runtime to satisfy types.