(cg: CodeGraph, qualifiedName: string)
| 36 | } |
| 37 | |
| 38 | function callable(cg: CodeGraph, qualifiedName: string): Node { |
| 39 | const node = [...cg.getNodesByKind('method'), ...cg.getNodesByKind('function')].find((n) => n.qualifiedName === qualifiedName); |
| 40 | if (!node) throw new Error(`no function or method ${qualifiedName}`); |
| 41 | return node; |
| 42 | } |
| 43 | |
| 44 | /** `calls` edges of a function or method, as `qualifiedName @confidence`, one per call. */ |
| 45 | function calls(cg: CodeGraph, caller: string): string[] { |