Build discriminated union types with type-safe variant handling
Discriminated unions use a common property (discriminator) to distinguish between different object shapes. TypeScript can then narrow the type based on this property.
Help others discover this tool!