(dir: string, files: Files)
| 71 | }); |
| 72 | |
| 73 | const write = (dir: string, files: Files): void => { |
| 74 | for (const [rel, content] of Object.entries(files)) { |
| 75 | const file = path.join(dir, rel); |
| 76 | if (content === null) { |
| 77 | fs.rmSync(file, { force: true }); |
| 78 | continue; |
| 79 | } |
| 80 | fs.mkdirSync(path.dirname(file), { recursive: true }); |
| 81 | fs.writeFileSync(file, content); |
| 82 | } |
| 83 | }; |
| 84 | /** A project of `files`, indexed from scratch in a folder of its own. */ |
| 85 | const indexed = async (files: Files): Promise<{ dir: string; graph: CodeGraph }> => { |
| 86 | const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-sync-nested-barrel-')); |
no test coverage detected