extend
or merge
with instanceof
#1430
ricardo-valero
started this conversation in
Ideas
Replies: 1 comment
-
Or maybe an I guess this works export const schema = z.object({
avatar: z.intersection(
z.instanceof(File),
z.object({
size: z.number().min(5).max(30_000),
type: z.enum(['image/jpeg', 'image/jpg', 'image/png', 'image/webp']),
}))
}) But any insight is appreciated |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to
extend
ormerge
an existing instance?I know you could use something like
refine
, mentioned in #796 (comment)but would it be possible to reuse zod's primitives?
Beta Was this translation helpful? Give feedback.
All reactions