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

Function ifaceMethods

src/resolution/callback-synthesizer.ts:1613–1631  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

1611 };
1612 const ifaceMemo = new Map<string, Set<string>>();
1613 const ifaceMethods = (id: string): Set<string> => {
1614 let names = ifaceMemo.get(id);
1615 if (!names) {
1616 names = new Set<string>();
1617 const reached = new Set<string>([id]);
1618 const pending = [id];
1619 while (pending.length > 0) {
1620 const at = pending.pop()!;
1621 for (const m of methodsOf(at)) names.add(goMethodKey(m));
1622 for (const e of embeds(at)) {
1623 if (reached.has(e.target)) continue;
1624 reached.add(e.target);
1625 pending.push(e.target);
1626 }
1627 }
1628 ifaceMemo.set(id, names);
1629 }
1630 return names;
1631 };
1632 const provides = (id: string, key: string): boolean =>
1633 kindOf(id) === 'interface' ? ifaceMethods(id).has(key) : methodsOf(id).some((m) => goMethodKey(m) === key);
1634

Callers 1

providesFunction · 0.85

Calls 8

goMethodKeyFunction · 0.85
embedsFunction · 0.85
hasMethod · 0.80
pushMethod · 0.80
methodsOfFunction · 0.70
getMethod · 0.65
addMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected