adonisjs / validator

Schema based validator for AdonisJS
MIT License
116 stars 39 forks source link

String validation rule accepting sanitize methods like uppcase, lowercase, etc... #93

Closed popovicieduard closed 3 years ago

popovicieduard commented 4 years ago

Why this feature is required (specific use-cases will be appreciated)?

In v4 you could register sanitazor methods to the validator, it would be nice to have some sanitazation rules on strings rules, like to uppsercase, to lowercase, trim.

Have you tried any other work arounds?

This can be done before using the validator validate method, but you would have to keep track of 2 places for a single use case.

Are you willing to work on it with little guidance?

Yes.

thetutlage commented 4 years ago

We already have escape and trim options on the string schema type. I am not 100% sure about the casing options, coz the possibilities are unlimited. For example:

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.