Created
June 19, 2019 21:42
-
-
Save HigoRibeiro/27db872278428e734186d299a80c207b 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