UNPKG

@tyagoveras/node-mde

Version:

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

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