Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs validator typo variable #146

Open
dawidmachon opened this issue Jun 11, 2022 · 1 comment
Open

Docs validator typo variable #146

dawidmachon opened this issue Jun 11, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@dawidmachon
Copy link
Contributor

Describe the bug

On docs:
https://felte.dev/docs/svelte/validators#using-yup
section Warnings code has typo I think.
validator({ schema }), should be validator({ validateSchema }),

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' }),
  ],
  // ...
});

Which package/s are you using?

@felte/validator-yup

Environment

  • OS:
  • Browser:
  • Version:

To reproduce

No response

Small reproduction example

No response

Screenshots

No response

Additional context

No response

@pablo-abc
Copy link
Owner

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants