(files: Record<string, string>)
| 23 | }); |
| 24 | |
| 25 | async function indexProject(files: Record<string, string>): Promise<CodeGraph> { |
| 26 | const root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-ws-browser-')); |
| 27 | roots.push(root); |
| 28 | for (const [rel, content] of Object.entries(files)) { |
| 29 | fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true }); |
| 30 | fs.writeFileSync(path.join(root, rel), content); |
| 31 | } |
| 32 | const cg = await CodeGraph.init(root, { index: true }); |
| 33 | graphs.push(cg); |
| 34 | return cg; |
| 35 | } |
| 36 | |
| 37 | /** Where a function's calls land: `<file>:<qualified name>`, sorted. */ |
| 38 | function callsOf(cg: CodeGraph, fn: string): string[] { |
no test coverage detected