Skip to content

Instantly share code, notes, and snippets.

@HigoRibeiro
Created June 19, 2019 21:42
Show Gist options
  • Save HigoRibeiro/27db872278428e734186d299a80c207b to your computer and use it in GitHub Desktop.
Save HigoRibeiro/27db872278428e734186d299a80c207b to your computer and use it in GitHub Desktop.
Adonis sanitization
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