Closed justinforlenza closed 11 months ago
When using the alternate (|) operator in a regex it does not get properly generated.
|
For example:
model X { time String /// @zod.string.regex(/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/) }
Will generate the following:
export const XSchema = z.object({ /** * .regex(/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/) */ time: z.string(), })
I believe this relates to #78 in that regex needs to be tweaked to accept the pipe symbol.
When using the alternate (
|
) operator in a regex it does not get properly generated.For example:
Will generate the following:
I believe this relates to #78 in that regex needs to be tweaked to accept the pipe symbol.