MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / delete

Method delete

packages/filesystem/s3/s3.ts:185–195  ·  view source on GitHub ↗

* 删除文件 * 此操作幂等——删除不存在的文件也会成功 * @param path 相对于当前 basePath 的文件路径

(path: string)

Source from the content-addressed store, hash-verified

183 * @param path 相对于当前 basePath 的文件路径
184 */
185 async delete(path: string): Promise<void> {
186 try {
187 await this.client.request("DELETE", this.bucket, joinPath(this.basePath, path).substring(1));
188 } catch (error: any) {
189 // S3 delete 是幂等的,key 不存在时也视为成功
190 if (error instanceof S3Error && error.code === "NoSuchKey") {
191 return;
192 }
193 throw error;
194 }
195 }
196
197 /**
198 * 列出当前目录下的文件

Callers

nothing calls this directly

Calls 2

joinPathFunction · 0.90
requestMethod · 0.45

Tested by

no test coverage detected