CPF and CNPJ validators for VeeValidate 3
CPF and CNPJ validators for VeeValidate 3
This package is a simple wrapper around the @fnando/cnpj and
@fnando/cpf validators to expose an validation object ready to be imported
into VeeValidate
This lib is available as a NPM package. To install it, use the following command:
```
npm install vee-cpf-cnpj --save
Or, if you're using yarn
``
yarn add vee-cpf-cnpj
`js
// @import
import { cpf, cnpj, cpfOrCnpj } from 'vee-cpf-cnpj'; // import what you need
// add validators to VeeValidate
extend('cpf', cpf);
extend('cnpj', cnpj);
extend('cpf_or_cnpj', cnpj);
`
#### cpf
The field under validation must a valid CPF
#### cnpj
The field under validation must a valid CNPJ
#### cpfOrCnpj`
The field under validation must either a valid CPF or a valid CNPJ