A library of validations applicable to several Brazilian data like I.E., CNPJ, CPF and others.
npm install --save br-validations
bower install --save br-validations
gulp test
var BrV = require('./br-validations');
var uf = 'PE';
var ie = '1321418-40';
var isValid = BrV.ie(uf).validate(ie);
See: Conferência de Inscrições Estaduais
var BrV = require('./br-validations');
var cpf = '219.841.712-08';
var isValid = BrV.cpf.validate(cpf);
var BrV = require('./br-validations');
var cnpj = '10.157.471/0001-61';
var isValid = BrV.cnpj(uf).validate(cnpj);
Not implemented yet
var BrV = require('./br-validations');
var pis = '120.5825.883-7';
var isValid = BrV.pis.validate(pis);
We'd love for you to contribute to our source code! We just ask for you to:
- Follow the commit conventions of conventional-changelog described in conventional-conventions
- Write tests for the new feature or bug fix that you are solving
- Ensure all tests pass before send the pull-request (Use:
$ gulp test-coverage
)