node-mde
Version:
Biblioteca para consultar notas destinadas e enviar evento de manifestação do destinatário
19 lines (18 loc) • 488 B
JavaScript
class AmbienteValidator {
constructor(t) {
t = t.tpAmb;
this.tpAmb = t, this.error = "";
}
isValid() {
return this.tpAmb ? "1" === this.tpAmb || "2" === this.tpAmb || !(this.error = "Ambiente com valor inválido.") : !(this.error = "Ambiente não informado.");
}
getValues() {
return {
tpAmb: this.tpAmb
};
}
getError() {
return this.error;
}
}
module.exports = Object.freeze(AmbienteValidator);