diff --git a/src/schema.ts b/src/schema.ts index 23e2938d..6147f562 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -66,7 +66,9 @@ const localeSchema = z.string().transform((val, ctx) => { }); /** White-space separated list of sizes, each in the format x or with "X" in upper case. */ -const sizesSchema = z.string().regex(/^(?:[1-9]\d{0,3}[xX][1-9]\d{0,3})(?:\s+[1-9]\d{0,3}[xX][1-9]\d{0,3})*$/); +const sizesSchema = z.string().refine((value) => + value.split(' ').every((v) => /^[1-9]\d{0,3}[xX][1-9]\d{0,3}$/.test(v)) +); export { booleanParamSchema,