Closed gcfabri closed 5 years ago
I am facing a situation in which a user input document number is expected, it can be a CPF or a CNPJ. When the entry is a known CNPJ invalid, the result of the validation of the CPF is true.
if (isCPFValid || isCNPJValid) { // ...do stuff } else { // ...do stuff }
const { validateBr } = require('js-brasil'); const str = '00.000.000/0000-00'; const test = validateBr.cpf(str); console.log(test); // true
Thanks!
Fixed in 1.1.9
I am facing a situation in which a user input document number is expected, it can be a CPF or a CNPJ. When the entry is a known CNPJ invalid, the result of the validation of the CPF is true.