Typescript Unions based on property inside nested object

The compiler doesn’t understand the concept of “nested discriminated unions”. A type is a discriminated union if the members of the union share a common “discriminant” property. A discriminant property is generally a singleton/literal type like true or “hello” or 123 or even null or undefined. You can’t use another discriminated union as a discriminant … Read more