1.0.2 • Published 8 months ago

@andrebenedetti/cpf-cnpj-validator v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

cpf-cnpj-validator

Fork and rewrite of cpf-cnpj-validator with only essential code to validate CPFs and CNPJs.

Fork e reescrita somente com código essencial para validar CPFs e CNPJs.

MIT

Installation

npm i @andrebenedetti/cpf-cnpj-validator

Usage

import { isValidCnpj, isValidCpf } from "@andrebenedetti/cpf-cnpj-validator";

isValidCnpj("12345678901234");
isValidCpf("12345678901");

Notes on validation

All non-numeric characters will be removed before validation. For instance, this will return true:

isValidCpf("20@923##%14@!8,230"); // returns true

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago