Hacker News new | ask | show | jobs
by seniorsassycat 432 days ago
Which typescript features are improving runtime validation?
1 comments

Previously (~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.