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

z.string().cuid2() validator doesn't conform to the upstream format #2960

Closed
etareduction opened this issue Nov 13, 2023 · 1 comment · Fixed by #2961
Closed

z.string().cuid2() validator doesn't conform to the upstream format #2960

etareduction opened this issue Nov 13, 2023 · 1 comment · Fixed by #2961

Comments

@etareduction
Copy link
Contributor

Regex which is defined for cuid2 format validation doesn't conform to the one defined in the cuid2 library itself.
It bothers me as i can't use this validator with ids generated by this elixir implementation of cuid2: https://github.com/joseph-lozano/cuid2

Said regex in the zod codebase:
https://github.com/colinhacks/zod/blob/master/src/types.ts#L549

Regex in the upstream cuid2 codebase:
https://github.com/paralleldrive/cuid2/blob/main/src/index.js#L105

@colinhacks
Copy link
Owner

colinhacks commented Apr 16, 2024

Seems reasonable. Thanks!

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 a pull request may close this issue.

2 participants