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

Function routeComponent

src/resolution/frameworks/angular-router.ts:422–427  ·  view source on GitHub ↗

The class a route's component names, by its import (or this file) — or a lazy import's.

(encoded: string, fromFile: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

420
421/** The class a route's component names, by its import (or this file) — or a lazy import's. */
422function routeComponent(encoded: string, fromFile: string, context: ResolutionContext): Node | null {
423 const lazy = LAZY_COMPONENT_REF.exec(encoded);
424 if (lazy) return lazyComponent(lazy[1]!, lazy[2] === 'default' ? null : lazy[2]!, fromFile, context);
425 const file = declaringFile(encoded, fromFile, context);
426 return file ? (context.getNodesInFile(file).find((n) => n.kind === 'class' && n.name === encoded) ?? null) : null;
427}
428
429// =============================================================================
430// The cross-file pass: mounts and constant paths

Callers 1

resolveFunction · 0.70

Calls 4

lazyComponentFunction · 0.85
declaringFileFunction · 0.85
execMethod · 0.65
getNodesInFileMethod · 0.65

Tested by

no test coverage detected