vee-cpf-cnpj

1.0.2 • Public • Published

vee-cpf-cnpj

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

Installation

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

Usage

// @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);

Available validators

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

/vee-cpf-cnpj/

    Package Sidebar

    Install

    npm i vee-cpf-cnpj

    Weekly Downloads

    27

    Version

    1.0.2

    License

    ISC

    Unpacked Size

    1.73 kB

    Total Files

    3

    Last publish

    Collaborators

    • vitorbortolotti