6 ms·
Which typescript features are improving runtime validation?
by seniorsassycat 1y ago
Which typescript features are improving runtime validation?
- madeofpalk 1y agoPreviously (~2-3 years ago), it was impossible to narrow `unknown` to a fully typed object. Recently-ish, they added the ability for `"foo" in obj` to type-refine `object` to `object & {"foo": unknown}`, which lets you further narrow foo down to something more specific.