` -> : ` for each function-as-value edge leaving `file`.
(cg: CodeGraph, file: string)
| 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[] { |
| 39 | const ids = cg.getNodesInFile(file).map((n) => n.id); |
| 40 | return [...new Set(cg |
| 41 | .getOutgoingEdgesFrom(ids) |
| 42 | .filter((e) => e.metadata?.fnRef === true) |
| 43 | .map((e) => { |
| 44 | const target = cg.getNode(e.target); |
| 45 | return `${String(e.metadata?.refName)} -> ${target?.filePath}:${target?.qualifiedName}`; |
| 46 | }))] |
| 47 | .sort(); |
| 48 | } |
| 49 | |
| 50 | describe('a function value the file imports from a package', () => { |
| 51 | it('never lands on a project function of the same name', async () => { |
no test coverage detected