How to convert zod image scheme to valibot image scheme? #754
-
Hello, i tried to convert
to valid |
Beta Was this translation helpful? Give feedback.
Answered by
fabian-hiller
Jul 29, 2024
Replies: 1 comment 1 reply
-
This will work in the next version of Valibot: import * as v from 'valibot';
const Schema = v.optional(
v.pipe(v.instance(FileList), v.nonEmpty('Please upload one or more images'))
); For the current version use: import * as v from 'valibot';
const Schema = v.optional(
v.pipe(
v.instance(FileList),
v.check((files) => !!files.length, 'Please upload one or more images')
)
); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Enkratia
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This will work in the next version of Valibot:
For the current version use: