@tadashi/doc

Validate CPF/CNPJ.

Usage no npm install needed!

<script type="module">
  import tadashiDoc from 'https://cdn.skypack.dev/@tadashi/doc';
</script>

README

doc

NPM version Node.js CI Coverage Status

XO code style

Validate CPF/CNPJ.

Install

$ npm i -S @tadashi/doc

API

onlyNumber(c: string): array
isCnpj(c: string): boolean
isCpf(c: string): boolean

Usage

import {isCnpj, isCpf, onlyNumber} from '@tadashi/doc'

isCpf('090.885.670-93')      // => true
isCnpj('29.249.091/0001-85') // => true
onlyNumber('1.2.3')          // => [1, 2, 3]

License

MIT © Thiago Lagden