(dir: string, files: Record<string, string>)
| 21 | } |
| 22 | |
| 23 | async function indexProject(dir: string, files: Record<string, string>): Promise<void> { |
| 24 | for (const [rel, content] of Object.entries(files)) { |
| 25 | const abs = path.join(dir, rel); |
| 26 | fs.mkdirSync(path.dirname(abs), { recursive: true }); |
| 27 | fs.writeFileSync(abs, content); |
| 28 | } |
| 29 | const cg = CodeGraph.initSync(dir); |
| 30 | await cg.indexAll(); |
| 31 | cg.close(); |
| 32 | } |
| 33 | |
| 34 | /** `count` files in one import ring: each imports the next, the last the first. */ |
| 35 | function ring(count: number): Record<string, string> { |
no test coverage detected