async rmdir()

in packages/web-ide-fs/src/browserfs/OverlayFSImpl.ts [259:273]


  async rmdir(p: string): Promise<void> {
    // Original impl https://github.com/jvilk/BrowserFS/blob/v1.4.3/src/backend/OverlayFS.ts#L530
    // See "Delete Strategy" in class description
    if (!(await this.exists(p))) {
      throw ApiError.ENOENT(p);
    }

    if (await this.#existsInWritable(p)) {
      await this.#writable.rmdir(p);
    }

    if (await this.#existsInReadable(p)) {
      await this.#deletedFiles.append('dir', p);
    }
  }