Closed cohenerickson closed 8 months ago
@cohenerickson this should work now in the latest version 2.7.13
- at least it did with my test schema.
Jsut out of curiosity: Is there a reason you do not use the z.string().email()
validator?
@cohenerickson this should work now in the latest version
2.7.13
- at least it did with my test schema. Jsut out of curiosity: Is there a reason you do not use thez.string().email()
validator?
At first I was unaware that z.string().email()
existed so I tried to use a regex to validate it. Once I had discovered that zod did have a built in email validator, I figured I should still create an issue here to document it.
input:
output:
Using @zod.custom.use with .regex and .refine had the same result
I think it is something to do with the parsing of the '@' character, likely an artifact of '@zod' rule