Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for UnionToIntersection #69

Open
haejunejung opened this issue Sep 5, 2024 · 0 comments · May be fixed by #76
Open

Support for UnionToIntersection #69

haejunejung opened this issue Sep 5, 2024 · 0 comments · May be fixed by #76
Labels
enhancement New feature or request

Comments

@haejunejung
Copy link
Owner

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 }.
@haejunejung haejunejung added the enhancement New feature or request label Sep 5, 2024
@haejunejung haejunejung linked a pull request Sep 24, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant