autocomplete_response.js 461 B

1234567891011121314151617181920212223
  1. import { bool_response } from "./bool_response";
  2. export class autocomplete_response extends bool_response {
  3. #found;
  4. constructor(target) {
  5. super(target);
  6. this.#found = null;
  7. if (this.result) {
  8. this.#found = target["found"];
  9. }
  10. }
  11. get found() {
  12. if (this.#found === null) {
  13. throw new Error("Server response is not complete.");
  14. }
  15. return this.#found;
  16. }
  17. }