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

Method write

packages/filesystem/dropbox/rw.ts:61–72  ·  view source on GitHub ↗
(content: string | Blob)

Source from the content-addressed store, hash-verified

59 }
60
61 async write(content: string | Blob): Promise<void> {
62 // 检查文件是否存在
63 const exists = await this.fs.exists(this.path);
64
65 if (exists) {
66 // 如果文件存在,则更新
67 return this.updateFile(content);
68 } else {
69 // 如果文件不存在,则创建
70 return this.createNewFile(content);
71 }
72 }
73
74 private async updateFile(content: string | Blob): Promise<void> {
75 const myHeaders = new Headers();

Callers

nothing calls this directly

Calls 3

updateFileMethod · 0.95
createNewFileMethod · 0.95
existsMethod · 0.80

Tested by

no test coverage detected