bool_response.js 358 B

123456789101112131415161718192021
  1. export class bool_response {
  2. #result;
  3. #cause;
  4. constructor(target) {
  5. this.#result = (target.result === "success");
  6. this.#cause = null;
  7. if (!this.result) {
  8. this.#cause = target.cause;
  9. }
  10. }
  11. get cause() {
  12. return this.#cause;
  13. }
  14. get result() {
  15. return this.#result;
  16. }
  17. }