(path: string, content: string | Uint8Array)
| 51 | } |
| 52 | |
| 53 | async appendFile(path: string, content: string | Uint8Array): Promise<void> { |
| 54 | if (typeof content === "string") { |
| 55 | await this.ws.appendFile(path, content); |
| 56 | return; |
| 57 | } |
| 58 | |
| 59 | const existing = await this.ws.readFileBytes(path); |
| 60 | if (existing === null) { |
| 61 | await this.ws.writeFileBytes(path, content); |
| 62 | return; |
| 63 | } |
| 64 | |
| 65 | const combined = new Uint8Array(existing.byteLength + content.byteLength); |
| 66 | combined.set(existing); |
| 67 | combined.set(content, existing.byteLength); |
| 68 | await this.ws.writeFileBytes(path, combined); |
| 69 | } |
| 70 | |
| 71 | async exists(path: string): Promise<boolean> { |
| 72 | return this.ws.exists(path); |
nothing calls this directly
no test coverage detected