feat(Form): support for valibot@33 (#132)

This commit is contained in:
Romain Hamel
2024-07-01 10:52:27 +02:00
committed by GitHub
parent 225d28d279
commit 20acc92eec
6 changed files with 95 additions and 21 deletions

View File

@@ -106,14 +106,19 @@ describe('Form', () => {
}
],
['valibot', {
schema: valibot.objectAsync({
schema: valibot.object({
email: valibot.string(),
password: valibot.string([
valibot.minLength(8, 'Must be at least 8 characters')
])
password: valibot.pipe(valibot.string(), valibot.minLength(8, 'Must be at least 8 characters'))
})
}
],
['valibot safeParser', {
schema: valibot.safeParser(valibot.object({
email: valibot.string(),
password: valibot.pipe(valibot.string(), valibot.minLength(8, 'Must be at least 8 characters'))
}))
}
],
['custom', {
async validate(state: any) {
const errs = []