(files: Record<string, string>)
| 29 | }); |
| 30 | |
| 31 | async function index(files: Record<string, string>): Promise<CodeGraph> { |
| 32 | const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-component-folder-')); |
| 33 | dirs.push(dir); |
| 34 | for (const [rel, content] of Object.entries(files)) { |
| 35 | fs.mkdirSync(path.dirname(path.join(dir, rel)), { recursive: true }); |
| 36 | fs.writeFileSync(path.join(dir, rel), content); |
| 37 | } |
| 38 | const cg = await CodeGraph.init(dir, { index: true }); |
| 39 | graphs.push(cg); |
| 40 | return cg; |
| 41 | } |
| 42 | |
| 43 | /** Every edge the framework resolvers made into a node named `name`, as `file` of the target. */ |
| 44 | function frameworkPicks(cg: CodeGraph, name: string): string[] { |
no test coverage detected