SAP-BTP-Spielwiese/app1/node_modules/@sap/xssec/lib/validator/ValidationResults.js
Markus Rettig 775ac7b58c completed step 3 from the tutorial
you must login with an BTP account in order to see the app
2024-02-08 16:13:36 +01:00

31 lines
No EOL
577 B
JavaScript

class ValidationResults {
#state;
#description;
constructor(state, description) {
this.#state = state;
this.#description = description || "";
}
isValid() {
return this.#state;
}
isErroneous() {
return !this.isValid();
}
getErrorDescription() {
return this.#description;
}
static createValid() {
return new ValidationResults(true);
}
static createInvalid(description) {
return new ValidationResults(false, description)
}
};
module.exports = ValidationResults;