(content: string | Blob)
| 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(); |
nothing calls this directly
no test coverage detected