MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / methodOf

Function methodOf

__tests__/go-promoted-dispatch.test.ts:253–260  ·  view source on GitHub ↗

An interface's method.

(graph: CodeGraph, iface: Node, name: string)

Source from the content-addressed store, hash-verified

251
252/** An interface's method. */
253function methodOf(graph: CodeGraph, iface: Node, name: string): Node {
254 const m = graph
255 .getOutgoingEdgesFrom([iface.id], ['contains'])
256 .map((e) => graph.getNode(e.target))
257 .find((n) => n?.name === name);
258 expect(m, `${iface.name}.${name}`).toBeTruthy();
259 return m!;
260}
261
262/** Where a call through the method dispatches, as `Target::m` or `Target::m <- promotedInto @registeredAt`. */
263function dispatch(graph: CodeGraph, method: Node): string[] {

Callers 2

closeFunction · 0.70

Calls 3

mapMethod · 0.80
getNodeMethod · 0.80
getOutgoingEdgesFromMethod · 0.45

Tested by

no test coverage detected