Is there a way I can ensure a union type is exhaustive with all the values of a type union instead of an array?
For example, this is the goal:
type keys = 'a' | 'b' | 'c'
type map = {
key: 'a',
} | {
key: 'b'
}
// ^ This should error because it's missing an object with a key of 'c'
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.