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

Anyone know how to turn "A" | "B" => ["A", "B"]? #251

Closed
alita-moore opened this issue Aug 21, 2021 · 4 comments
Closed

Anyone know how to turn "A" | "B" => ["A", "B"]? #251

alita-moore opened this issue Aug 21, 2021 · 4 comments

Comments

@alita-moore
Copy link

I have been trying to do this for a bit too long.. I give up.

Anyone else know of a way to convert the string OR types into a type array?

@xianshenglu
Copy link

https://stackoverflow.com/questions/55127004/how-to-transform-union-type-to-tuple-type

@alita-moore
Copy link
Author

Thank you. If the purpose is only for strings and the order of the output doesn't matter do you think it's okay to use?

@xianshenglu
Copy link

I think so. I tested it and it works.

@papb
Copy link
Contributor

papb commented Jan 19, 2022

This was proposed on #167

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants