Open timfenton-dermi opened 6 months ago
@timfenton-dermi Thanks for pointing this out. I'll look into it
The only way I was able to get around this was to export my regex from an external file and add it to the @zod.import(...)
:
@zod.import(["import * as u from '.......';"])
...and do this:
/// @zod.custom.use(z.string().regex(u.PHONE_REGEX))
...though in doing that, I also discovered that imports only work for models, and not types... is that correct?
Describe the bug Attempting to use custom validator for validating a phone number is in e.164 format
this pattern is breaking the generation of the zod regex check:
expected output:
Package versions (please complete the following information):
seems to be related to the escaped characters + and \d