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

Function from

__tests__/sfc-component-owns-script.test.ts:21–22  ·  view source on GitHub ↗
(r: ExtractionResult, name: string)

Source from the content-addressed store, hash-verified

19
20const componentOf = (r: ExtractionResult) => r.nodes.find((n) => n.kind === 'component')!;
21const from = (r: ExtractionResult, name: string) =>
22 r.unresolvedReferences.filter((ref) => ref.referenceName === name && ref.referenceKind === 'calls').map((ref) => ref.fromNodeId);
23const parents = (r: ExtractionResult) => {
24 const out = new Map<string, string[]>();
25 for (const e of r.edges) if (e.kind === 'contains') out.set(e.target, [...(out.get(e.target) ?? []), e.source]);

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected