Open netgfx opened 6 months ago
I get Property 'regex' does not exist on type 'ZodEffects<ZodString, string, string>'
Property 'regex' does not exist on type 'ZodEffects<ZodString, string, string>'
I define the z.strng like this:
z.string({ required_error: 'Username is required', invalid_type_error: 'Name must be a string', }) .refine( (data: string) => data.length > 0, (val: string) => ({ message: 'Username cannot be empty', }), ) .regex(/^[a-zA-Z0-9]+$/, { message: 'Username can only contain alphanumeric characters', }) .min(3, {message: 'Username must be at least 3 characters long'}) .max(20, {message: 'Username cannot exceed 20 characters'})
Could this be because the zod version of the library is outdated? Locally I have zod version 3.23.8
might be. I'll try to release the updated version this week
Can you please try 1.2.0?
I get
Property 'regex' does not exist on type 'ZodEffects<ZodString, string, string>'
I define the z.strng like this:
Could this be because the zod version of the library is outdated? Locally I have zod version 3.23.8