(files: Record<string, string>)
| 24 | }); |
| 25 | |
| 26 | async function index(files: Record<string, string>): Promise<CodeGraph> { |
| 27 | root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-php-dir-include-')); |
| 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 | cg = await CodeGraph.init(root, { index: true }); |
| 33 | return cg; |
| 34 | } |
| 35 | |
| 36 | /** The files anything in `file` imports (the file, or its namespace), sorted. */ |
| 37 | function importsOf(graph: CodeGraph, file: string): string[] { |
no test coverage detected