@andrebenedetti/cpf-cnpj-validator
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @andrebenedetti/cpf-cnpj-validator

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

6.66 kB

Total Files

9

Last publish

Collaborators

  • andrebenedetti