mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-31 19:14:27 +01:00
refactor: sizesSchema
This commit is contained in:
@@ -66,7 +66,9 @@ const localeSchema = z.string().transform<Intl.Locale>((val, ctx) => {
|
||||
});
|
||||
|
||||
/** White-space separated list of sizes, each in the format <number with up to 4 digits>x<number with up to 4 digits> 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,
|
||||
|
||||
Reference in New Issue
Block a user