Narrowing Unions Without a Single Type Assertion
Discriminants, type guards, and the satisfies operator doing the work for you.
👍 3
·
💬 10
3 posts
Showing 3 posts
Discriminants, type guards, and the satisfies operator doing the work for you.
Validate untrusted input once at the boundary and let inference handle the rest.
Six confusing compiler errors and what each one is really telling you.