(files: Record<string, string>)
| 27 | }); |
| 28 | |
| 29 | async function index(files: Record<string, string>): Promise<CodeGraph> { |
| 30 | const root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-require-missing-')); |
| 31 | roots.push(root); |
| 32 | for (const [rel, content] of Object.entries(files)) { |
| 33 | const file = path.join(root, rel); |
| 34 | fs.mkdirSync(path.dirname(file), { recursive: true }); |
| 35 | fs.writeFileSync(file, content); |
| 36 | } |
| 37 | const graph = await CodeGraph.init(root, { index: true }); |
| 38 | graphs.push(graph); |
| 39 | return graph; |
| 40 | } |
| 41 | |
| 42 | /** `caller -> file:qualifiedName` for every `calls` edge out of `file`. */ |
| 43 | function callsFrom(graph: CodeGraph, file: string): string[] { |
no test coverage detected