Skip to content

Commit

Permalink
fix(types): 🐛 fix regexes in zod types
Browse files Browse the repository at this point in the history
  • Loading branch information
djdembeck committed Feb 13, 2023
1 parent c18eca7 commit 4161ad6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { z } from 'zod'
import { asin10Regex, asin11Regex } from '#helpers/utils/shared'

// Reusable types
const asin = z.string().regex(asin10Regex)
const genreAsin = z.string().regex(asin11Regex)
const asin = z.string().regex(new RegExp(asin10Regex, 'g'))
const genreAsin = z.string().regex(new RegExp(asin11Regex, 'g'))
const nameOrTitle = z.string().min(1)

// Chapters
Expand Down Expand Up @@ -178,7 +178,7 @@ const baseShape = z.object({
sku_lite: z.string().optional(),
social_media_images: z.record(z.string()),
subtitle: z.string().optional(),
thesaurus_subject_keywords: z.array(z.string()),
thesaurus_subject_keywords: z.array(z.string()).optional(),
title: nameOrTitle
})

Expand Down

0 comments on commit 4161ad6

Please sign in to comment.