(files: Record<string, string>)
| 3576 | // constant's extent, so `api.call()` resolved to nothing in the defining |
| 3577 | // file and to the CONSTANT through an import — zero callers everywhere. |
| 3578 | const setup = (files: Record<string, string>) => { |
| 3579 | const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-1573-')); |
| 3580 | for (const [name, content] of Object.entries(files)) { |
| 3581 | fs.mkdirSync(path.dirname(path.join(tmpDir, name)), { recursive: true }); |
| 3582 | fs.writeFileSync(path.join(tmpDir, name), content); |
| 3583 | } |
| 3584 | return tmpDir; |
| 3585 | }; |
| 3586 | const callersOf = async (cg: CodeGraph, name: string, kind: string, filePath?: string) => { |
| 3587 | const target = (await cg.searchNodes(name, { limit: 20 })).find( |
| 3588 | (r) => r.node.kind === kind && r.node.name === name && (!filePath || r.node.filePath === filePath) |
no test coverage detected