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

Support for validator class in validation arrays #565

Conversation

jbescoyez
Copy link
Contributor

Changes proposed in this pull request

Class validators are great!
However, they do not work when there is more than 1 validation for a given attribute.

It would be perfect if this kind of validator map could be supported:

const validatorMap = {
  name: [
    validatePresence(true),
    validateLength({ min: 4 })
    new PersonalValidator()
  ],
};

@jbescoyez jbescoyez changed the title Test for validator class in array Support for validator class in validator arrays Dec 4, 2020
@jbescoyez jbescoyez changed the title Support for validator class in validator arrays Support for validator class in validation arrays Dec 4, 2020
@snewcomer
Copy link
Collaborator

Oh interesting! Thanks for the PR. I'll look to fix this weekend.

@jbescoyez
Copy link
Contributor Author

Tnx @snewcomer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants