-
-
Save tridungle/d80ee7d5e6d49af8f3692a0e4a87318d to your computer and use it in GitHub Desktop.
Adonis sanitization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { hooks } = require('@adonisjs/ignitor'); | |
hooks.after.providersBooted(() => { | |
const Validator = use('Validator'); | |
function normalizeCpf(cpf) { | |
return cpf | |
} | |
Validator.sanitizor.cpf = (val) => { | |
return normalizeCpf(val); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment