@tyagoveras/node-mde
Version:
Biblioteca para consultar notas destinadas e enviar evento de manifestação do destinatário
16 lines (15 loc) • 467 B
JavaScript
class ChaveCteValidator {
constructor(e) {
this.chave = e, this.error = "";
}
isValid() {
return this.chave ? (this.chave = String(this.chave), 44 === this.chave.length || !(this.error = "Chave do CT-e com tamanho incorreto.")) : !(this.error = "Chave do CT-e não informada.");
}
getValues() {
return this.chave;
}
getError() {
return this.error;
}
}
module.exports = Object.freeze(ChaveCteValidator);