Skip to content

Instantly share code, notes, and snippets.

View naider's full-sized avatar
🖥️

Naider Araújo naider

🖥️
View GitHub Profile
@naider
naider / cnpj.validation.js
Last active October 16, 2020 19:43 — forked from alexbruno/valid.cnpj.ts
Validação de CNPJ
export function cnpjValidation(value) {
if (!value) return false
// Aceita receber o valor como string, número ou array com todos os dígitos
const validTypes =
typeof value === 'string' || Number.isInteger(value) || Array.isArray(value)
// Elimina valor em formato inválido
if (!validTypes) return false