Skip to content

Instantly share code, notes, and snippets.

View lucaspiressimao's full-sized avatar

Lucas Pires Simão lucaspiressimao

  • Dooloop
  • Franca - SP - BR
View GitHub Profile
@lucaspiressimao
lucaspiressimao / cnpj.js
Created August 19, 2020 15:04
Validar CNPJ em js
validateCNPJ = cnpj => {
function getDV(value) {
let regDigits = (value.split('')).reverse()
let mod1 = getModule(regDigits)
let mod2 = getModule([mod1,...regDigits])
return `${mod1}${mod2}`
}