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

Function lazyValueModules

src/resolution/frameworks/react.ts:716–726  ·  view source on GitHub ↗
(filePath: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

714 * gives a page its default export, rewires a barrel — redraws the tag.
715 */
716export function lazyValueModules(filePath: string, context: ResolutionContext): string[] {
717 const reads = new Set<string>();
718 for (const node of context.getNodesInFile(filePath)) {
719 if ((node.kind !== 'constant' && node.kind !== 'variable') || node.qualifiedName !== node.name || !isPascalCase(node.name)) continue;
720 const loaded = valueLoader(node, context);
721 if (!loaded) continue;
722 if (loaded.member === 'default') lazyRouteComponent(loaded.spec, filePath, context, reads);
723 else pickedExport(loaded.spec, loaded.member, filePath, context, reads);
724 }
725 return [...reads];
726}
727
728/** The module-level `const`, `let` or `var` `filePath` declares as `name`. */
729function declaredValue(name: string, filePath: string, context: ResolutionContext): Node | undefined {

Callers 1

collectInputsFunction · 0.90

Calls 5

valueLoaderFunction · 0.85
lazyRouteComponentFunction · 0.85
pickedExportFunction · 0.85
isPascalCaseFunction · 0.70
getNodesInFileMethod · 0.65

Tested by

no test coverage detected