Skip to content

Commit

Permalink
fix: alter email validation
Browse files Browse the repository at this point in the history
  • Loading branch information
alfsouza708 committed Jan 28, 2022
1 parent f8f4cd0 commit 3d998df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/validators/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ export default {
hasAtLeastOneNumber: (value) => /\d+/.test(value),
emailSolfacil: (condition) => (value) => {
return [
/[a-zA-Z]+@solfacil.com.br/.test(value),
/[a-zA-Z]+@example.com/.test(value),
/[a-zA-Z0-9.]+@solfacil.com.br/.test(value),
/[a-zA-Z0-9.]+@example.com/.test(value),
][Number(condition === 'development')];
},
emailHasBrDomain: (condition) => (value) => {
return [/.br/.test(value), true][Number(condition === 'development')];
return [/.br$/.test(value), true][Number(condition === 'development')];
},
cpf: (value) => /^\d{3}\.\d{3}\.\d{3}\55\d{2}$/.test(value),
cnpj: (value) => /^\d{2}\.\d{3}\.\d{3}\/\d{4}\55\d{2}$/.test(value),
Expand Down

0 comments on commit 3d998df

Please sign in to comment.