import { validator } from '@felte/validator-yup';
import * as yup from 'yup';
const validateSchema = yup.object({
email: yup.string().email().required(),
password: yup.string().required(),
});
// We only warn if the user has already started typing a value
const warnSchema = yup.object({
password: yup
.string()
.test('is-secure', 'password is not secure', (value) =>
value ? value.length > 8 : true
),
});
const { form } = createForm({
// ...
extend: [
validator({ schema }),
validator({ schema: warnSchema, level: 'warning' }),
],
// ...
});
Hey! I'm really sorry for the delay. What version of validator-yup are you using? Might you be using a pre 1.0.0 version? Since 1.0.0 this package has the API that's currently represented in the docs!
Describe the bug
On docs: https://felte.dev/docs/svelte/validators#using-yup section Warnings code has typo I think.
validator({ schema }),
should bevalidator({ validateSchema }),
Which package/s are you using?
@felte/validator-yup
Environment
To reproduce
No response
Small reproduction example
No response
Screenshots
No response
Additional context
No response