The edges carrying a call's name out of the function or method `qualifiedName` in `file`.
(cg: CodeGraph, file: string, qualifiedName: string)
| 31 | |
| 32 | /** The edges carrying a call's name out of the function or method `qualifiedName` in `file`. */ |
| 33 | function callEdgesFrom(cg: CodeGraph, file: string, qualifiedName: string) { |
| 34 | const from = cg.getNodesInFile(file).filter((n) => n.qualifiedName === qualifiedName && (n.kind === 'function' || n.kind === 'method')); |
| 35 | expect(from.length).toBeGreaterThan(0); |
| 36 | return cg.getOutgoingEdgesFrom(from.map((n) => n.id)).flatMap((e) => { |
| 37 | const metadata = e.metadata as { refName?: string; resolvedBy?: string } | undefined; |
| 38 | return metadata?.refName ? [{ refName: metadata.refName, resolvedBy: metadata.resolvedBy, target: cg.getNode(e.target)!.qualifiedName }] : []; |
| 39 | }); |
| 40 | } |
| 41 | |
| 42 | /** `name -> target qualified name` for each call (or construction) the named function or method in `file` makes. */ |
| 43 | function callsFrom(cg: CodeGraph, file: string, qualifiedName: string): string[] { |
no test coverage detected