(root: string, files: Record<string, string | null>)
| 31 | }); |
| 32 | |
| 33 | function write(root: string, files: Record<string, string | null>): void { |
| 34 | for (const [rel, content] of Object.entries(files)) { |
| 35 | const file = path.join(root, rel); |
| 36 | if (content === null) { |
| 37 | fs.rmSync(file, { force: true }); |
| 38 | continue; |
| 39 | } |
| 40 | fs.mkdirSync(path.dirname(file), { recursive: true }); |
| 41 | fs.writeFileSync(file, content); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | async function index(files: Record<string, string>): Promise<CodeGraph> { |
| 46 | const root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-ws-entries-')); |
no test coverage detected