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

Function resolvePageComponent

src/resolution/frameworks/page-component.ts:38–44  ·  view source on GitHub ↗
(ref: UnresolvedRef, context: ResolutionContext)

Source from the content-addressed store, hash-verified

36
37/** A page route's reference to its file's own component, or null when this is not one. */
38export function resolvePageComponent(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null {
39 if (ref.referenceKind !== 'calls' || !ref.fromNodeId.startsWith(`route:${ref.filePath}:`)) return null;
40 const component = context
41 .getNodesInFile(ref.filePath)
42 .find((n) => n.kind === 'component' && n.name === ref.referenceName);
43 return component ? { original: ref, targetNodeId: component.id, confidence: 0.95, resolvedBy: 'framework' } : null;
44}

Callers 2

resolveFunction · 0.90
resolveFunction · 0.90

Calls 1

getNodesInFileMethod · 0.65

Tested by

no test coverage detected