-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
It provides support for UnionToIntersection.
It converts a union type into an intersection type. In a union type, you can choose one type from the options, but in an intersection type, you combin the properties of all types involved.
UntionToIntersection is especially useful when you need to combine multiple types' properties into a single type in more complex senarios, such as with mixins or when dealing with generics.
type A = { a: string };
type B = { b: string };
type Union = A | B; // A or B can be selected, but not both at once.
type Intersection = A & B // A mixed type that includes both { a: string } and { b: string }.Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request