1.0.2 • Published 1 month ago

burgos-documents v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 month ago

burgos-documents

Hooks for validating CPF and CNPJ documents

useValidateCPF

returns a method that receives a string as parameter and returns the boolean validation of this CPF.

import { useValidateCPF } from 'burgos-documents'

export const App = () => {
    const validateCPF = useValidateCPF()
    const cpf = '12345678901'

    console.log(validateCPF(cpf)) ## false
}
useValidateCNPJ

returns a method that receives a string, number or array of digits as parameter and returns the boolean validation of this CNPJ.

import { useValidateCNPJ } from 'burgos-documents'

export const App = () => {
    const validateCNPJ = useValidateCNPJ()
    const cnpj = '12345678901234'

    console.log(validateCNPJ(cnpj)) ## false
}
1.0.2

1 month ago

1.0.1

12 months ago

1.0.0

12 months ago