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

Function implementsFrom

__tests__/extraction.test.ts:1651–1657  ·  view source on GitHub ↗
(typeName: string)

Source from the content-addressed store, hash-verified

1649 // The implements back-reference comes FROM the implementing type's node
1650 // for every impl shape, named by the trait's full text.
1651 const implementsFrom = (typeName: string): string[] => {
1652 const typeNode = result.nodes.find((n) => n.name === typeName && n.kind === 'struct');
1653 expect(typeNode, typeName).toBeDefined();
1654 return result.unresolvedReferences
1655 .filter((r) => r.referenceKind === 'implements' && r.fromNodeId === typeNode!.id)
1656 .map((r) => r.referenceName);
1657 };
1658 expect(implementsFrom('FileSource')).toEqual(['Source']);
1659 expect(implementsFrom('BufSource')).toEqual(['Source']);
1660 expect(implementsFrom('Parents')).toEqual(['Iterator']);

Callers 1

extraction.test.tsFile · 0.85

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected