(outputDir: string, fileMap: FileMap)
| 406 | } |
| 407 | |
| 408 | function writeFileMap(outputDir: string, fileMap: FileMap) { |
| 409 | return Promise.all( |
| 410 | Object.entries(fileMap).map(async ([fileName, content]) => { |
| 411 | const absolutePath = path.join(outputDir, fileName) |
| 412 | // The deletion of the file is necessary, so VSCode |
| 413 | // picks up the changes. |
| 414 | await fs.rm(absolutePath, { recursive: true, force: true }) |
| 415 | if (typeof content === 'string') { |
| 416 | // file |
| 417 | await fs.writeFile(absolutePath, content) |
| 418 | } else { |
| 419 | // subdirectory |
| 420 | await fs.mkdir(absolutePath) |
| 421 | await writeFileMap(absolutePath, content) |
| 422 | } |
| 423 | }), |
| 424 | ) |
| 425 | } |
| 426 | |
| 427 | function isWasmEngineSupported(provider: ConnectorType) { |
| 428 | return ( |
no test coverage detected