0.0.5 • Published 7 years ago

verifica-documento v0.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Coverage Status Build Status

Brazilian Document Validator

Synopsis

This code just checks if a brazilian document (CPF, CNPJ or PIS) is valid or not based on your verify code. For the PIS there is the need of a extra parameter, a boolean, to inform that the verify code has one character.

Usage

CPF:

verificarDocumento('123.456.789-00'); // will return false
verificarDocumento('12345678900'); // will return false
verificarDocumento(12345678900); // will return false

verificarDocumento('123.456.789-09'); // will return true
verificarDocumento('12345678909'); // will return true
verificarDocumento(123.456.789-09); // will return true

CNPJ:

verificarDocumento('12.345.678/0001-00'); // will return false
verificarDocumento('12345678000100'); // will return false
verificarDocumento(12345678000100); // will return false

verificarDocumento('12.345.678/0001-95'); // will return true
verificarDocumento('12345678000195'); // will return true
verificarDocumento(12345678000195); // will return true

PIS:

verificarDocumento('123.4567.890-1', true); // will return false
verificarDocumento('12345678901', true); // will return false
verificarDocumento(12345678901, true); // will return false
verificarDocumento('123.4567.890-0', true); // will return true
verificarDocumento('12345678900', true); // will return true
verificarDocumento(12345678900, true); // will return true

// Second parameter boolean identifies if verify number has just one digit. Calculate changes.

Installation

npm install @pierrybos/verifica-documento

Tests

npm test

License

MIT

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago