mikeerickson / validatorjs

A data validation library in JavaScript for the browser and Node.js, inspired by Laravel's Validator.
https://www.npmjs.com/package/validatorjs
MIT License
1.77k stars 280 forks source link

Validator.registerAsync() callback documentation #464

Open sdr0x07b6 opened 1 year ago

sdr0x07b6 commented 1 year ago

What happened? The current document looks like this

Validator.registerAsync('username_available', function(username, attribute, req, passes) {

However, the order of attribute and req is actually reversed.

What did you expect to happen? It should be written like this

Validator.registerAsync('username_available', function(username, requirement, attribute, passes) {

Are you willing to submit a pull request to fix this bug? I don't know if they would even look at it if I submitted it.