async unlink()

in packages/web-ide-fs/src/browserfs/OverlayFSImpl.ts [302:316]


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

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

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