Concept Flow - The in operator narrowing
Start with union type variable
Use 'in' operator to check property
If property exists
Narrow type to subtype with that property
Use narrowed type safely
Else
Narrow type to other subtype
Use narrowed type safely
End
Check if a property exists in an object to tell TypeScript which subtype it is, so you can use it safely.