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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array/Tuple to Union #1

Closed
antfu opened this issue Jul 25, 2020 · 2 comments
Closed

Array/Tuple to Union #1

antfu opened this issue Jul 25, 2020 · 2 comments
Labels
question Question/demand, would need some help

Comments

@antfu
Copy link
Member

antfu commented Jul 25, 2020

馃挕 Question Request

Feel free to raise a question that you have faced in your projects,
please clearly describe it so people can better help you with it.

If we found it's solvable and good to be in our collection,
we will properly credit you as the original question provider.

An ArrayToUnions<T> generic coverting array/tuple to its values' union

const arr = ['foo', 'bar'] as const

type union = ArrayToUnion<typeof arr> // expect to be 'foo' | 'bar'
@antfu antfu added the question Question/demand, would need some help label Jul 25, 2020
@antfu
Copy link
Member Author

antfu commented Jul 25, 2020

@antfu
Copy link
Member Author

antfu commented Jul 26, 2020

Resolved by #7

@antfu antfu closed this as completed Jul 26, 2020
Leemainsw referenced this issue in Leemainsw/type-challenges Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question/demand, would need some help
Projects
None yet
Development

No branches or pull requests

1 participant