(files: Record<string, string>)
| 27 | }); |
| 28 | |
| 29 | const index = async (files: Record<string, string>): Promise<void> => { |
| 30 | dir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-alias-')); |
| 31 | for (const [name, content] of Object.entries(files)) { |
| 32 | fs.writeFileSync(path.join(dir, name), content); |
| 33 | } |
| 34 | cg = CodeGraph.initSync(dir, { config: { include: ['**/*.ts', '**/*.js'], exclude: [] } }); |
| 35 | await cg.indexAll(); |
| 36 | }; |
| 37 | |
| 38 | const callersOf = (name: string): string[] => { |
| 39 | const target = cg.getNodesByKind('function').find((n) => n.name === name); |
no test coverage detected