(
files: Array<{ path: string; content: string | unknown }>,
)
| 285 | * Each file object strictly follows the TextFile structure: path (directory) / name (filename) / content |
| 286 | */ |
| 287 | export const putTextFiles = async ( |
| 288 | files: Array<{ path: string; content: string | unknown }>, |
| 289 | ): Promise<void> => { |
| 290 | const manager = getClientComManager(); |
| 291 | const textFiles: TextFile[] = files.map((f) => { |
| 292 | const contentStr = typeof f.content === 'string' ? f.content : JSON.stringify(f.content); |
| 293 | return toTextFile(f.path, contentStr); |
| 294 | }); |
| 295 | const startTime = ts(); |
| 296 | const t0 = performance.now(); |
| 297 | await manager.putTextFilesByJSON({ files: textFiles }); |
| 298 | console.info( |
| 299 | `[FileApi][${startTime}] putTextFiles [${textFiles.length}] — ${(performance.now() - t0).toFixed(1)}ms`, |
| 300 | ); |
| 301 | }; |
| 302 | |
| 303 | // ============ App Path-Prefixed File API Factory ============ |
| 304 |
nothing calls this directly
no test coverage detected