Skip to content

Commit

Permalink
fix(types): 🐛 allow genre asin to either be 10 or 11 digits exactly
Browse files Browse the repository at this point in the history
allows for regions with non-standard genre lengths

fixes #571
  • Loading branch information
djdembeck committed Mar 6, 2023
1 parent d0b0876 commit ea338fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const asin11Regex = /\d{11}/gm
// Reusable types
export const AsinSchema = z.string().regex(asin10Regex)
// Using different regex for 11 digit ASINs because zod validation needs quantifier
export const GenreAsinSchema = z.string().regex(new RegExp(/^\d{11}$/gm))
export const GenreAsinSchema = z.string().regex(new RegExp(/^\d{10}$|^\d{11}$/))
export const NameSchema = z.string().min(2)
export const TitleSchema = z.string().min(1)
export const RegionSchema = z.enum(regionTLDs).default('us')
Expand Down

0 comments on commit ea338fa

Please sign in to comment.