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

Function componentInFile

src/resolution/frameworks/vue-router.ts:378–381  ·  view source on GitHub ↗
(file: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

376}
377
378function componentInFile(file: string, context: ResolutionContext): Node | null {
379 const nodes = context.getNodesInFile(file);
380 return nodes.find((n) => n.kind === 'component') ?? nodes.find((n) => n.kind === 'function' && /^[A-Z]/.test(n.name)) ?? null;
381}
382
383const COMPONENT_EXTENSIONS = ['', '.vue', '.tsx', '.jsx', '.ts', '.js', '/index.vue', '/index.tsx', '/index.ts', '/index.js'];
384

Callers 1

routeComponentFunction · 0.85

Calls 1

getNodesInFileMethod · 0.65

Tested by

no test coverage detected