UNPKG

node-mde

Version:

Biblioteca para consultar notas destinadas e enviar evento de manifestação do destinatário

16 lines (15 loc) 461 B
class ChaveValidator { constructor(r) { this.chave = r, this.error = ""; } isValid() { return this.chave ? (this.chave = String(this.chave), 44 === this.chave.length || !(this.error = "Chave da NF-e com tamanho incorreto.")) : !(this.error = "Chave da NF-e não informada."); } getValues() { return this.chave; } getError() { return this.error; } } module.exports = Object.freeze(ChaveValidator);