`caller -> Owner::method` for every `calls` edge out of `file` that lands on a method.
(graph: CodeGraph, file: string)
| 43 | |
| 44 | /** `caller -> Owner::method` for every `calls` edge out of `file` that lands on a method. */ |
| 45 | function methodCalls(graph: CodeGraph, file: string): string[] { |
| 46 | const out: string[] = []; |
| 47 | for (const node of graph.getNodesInFile(file)) { |
| 48 | for (const e of graph.getOutgoingEdges(node.id)) { |
| 49 | if (e.kind !== 'calls') continue; |
| 50 | const target = graph.getNode(e.target)!; |
| 51 | if (target.kind === 'method') out.push(`${node.name} -> ${target.qualifiedName}`); |
| 52 | } |
| 53 | } |
| 54 | return out.sort(); |
| 55 | } |
| 56 | |
| 57 | const BOUNDARY = 'import { Component } from "react";\nexport class Boundary extends Component<{ children?: React.ReactNode }> {\n render() { return this.props.children; }\n}\n'; |
| 58 |
no test coverage detected