` -> : ` for each function-as-value edge leaving `file`.
(cg: CodeGraph, file: string)
| 39 | |
| 40 | /** `<value name> -> <target file>:<target qualified name>` for each function-as-value edge leaving `file`. */ |
| 41 | function fnRefsFrom(cg: CodeGraph, file: string): string[] { |
| 42 | const ids = cg.getNodesInFile(file).map((n) => n.id); |
| 43 | return [...new Set(cg |
| 44 | .getOutgoingEdgesFrom(ids) |
| 45 | .filter((e) => e.metadata?.fnRef === true) |
| 46 | .map((e) => { |
| 47 | const target = cg.getNode(e.target); |
| 48 | return `${String(e.metadata?.refName)} -> ${target?.filePath}:${target?.qualifiedName}`; |
| 49 | }))] |
| 50 | .sort(); |
| 51 | } |
| 52 | |
| 53 | const PACKAGE_JSON = JSON.stringify({ name: 'wiki', dependencies: { react: '^18.2.0', 'styled-components': '^6.1.0' } }); |
| 54 | const TSCONFIG = JSON.stringify({ compilerOptions: { baseUrl: '.', jsx: 'react-jsx' } }); |
no test coverage detected