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

feat(utils): add arrayToEnum #66

Merged
merged 2 commits into from
Jul 16, 2023
Merged

feat(utils): add arrayToEnum #66

merged 2 commits into from
Jul 16, 2023

Conversation

hi-ogawa
Copy link
Owner

@hi-ogawa hi-ogawa commented Jul 16, 2023

It often happens that wishing to use z.enum to manage constants without typo but then most of the case you wouldn't want a whole zod.
So, here adding simple and quick alternative.
It also turns out that it can naturally support all number | string | symbol constants.

@hi-ogawa hi-ogawa merged commit ac75a4a into main Jul 16, 2023
2 checks passed
@hi-ogawa hi-ogawa deleted the feat-arrayToEnum branch July 16, 2023 02:18
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

Successfully merging this pull request may close these issues.

None yet

1 participant