TypeScript Lookup/Conditional Types and Unions

PHOTO EMBED

Thu Feb 03 2022 00:04:46 GMT+0000 (Coordinated Universal Time)

Saved by @antistructure #javascript

type Company = Extract<Entity, { __type: 'Employee' }>  
// Same as
type Company = {
    __type: "Employee";
    firstName: string;
}
content_copyCOPY

https://stackoverflow.com/questions/51285374/typescript-lookup-conditional-types-and-unions