(files: Record<string, string>)
| 25 | }); |
| 26 | |
| 27 | async function indexProject(files: Record<string, string>): Promise<CodeGraph> { |
| 28 | const root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-fnref-package-')); |
| 29 | roots.push(root); |
| 30 | for (const [rel, content] of Object.entries(files)) { |
| 31 | fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true }); |
| 32 | fs.writeFileSync(path.join(root, rel), content); |
| 33 | } |
| 34 | return CodeGraph.init(root, { index: true }); |
| 35 | } |
| 36 | |
| 37 | /** `<value name> -> <target file>:<target qualified name>` for each function-as-value edge leaving `file`. */ |
| 38 | function fnRefsFrom(cg: CodeGraph, file: string): string[] { |
no test coverage detected