Glossary: TypeScript Beyond the Basics
Discriminated union
Also written: discriminant
A union of object types that share a property, such as `ok: true` or `ok: false`, which tells you which member you have. Checking that property narrows the type.
Glossary: TypeScript Beyond the Basics
Also written: discriminant
A union of object types that share a property, such as `ok: true` or `ok: false`, which tells you which member you have. Checking that property narrows the type.