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

Function postExtract

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

* Put each routes file's routes under the path that lazy-loads it, and read * constant path segments. Recomputed from each route's in-file path (its * qualified name), so a second run changes nothing.

(context: ResolutionContext)

Source from the content-addressed store, hash-verified

1051 * qualified name), so a second run changes nothing.
1052 */
1053 postExtract(context: ResolutionContext): Node[] {
1054 const routes = context.getNodesByKind('route').filter(isAngularRoute);
1055 if (routes.length === 0) return [];
1056 const { prefixOf } = angularMounts(context, routes);
1057 const resolved = (pathText: string, file: string): string[] => resolvedSegments(pathText, file, context);
1058 const changed: Node[] = [];
1059 for (const route of routes) {
1060 const name = joinPath([...prefixOf(route.filePath), ...resolved(inFilePath(route), route.filePath)]);
1061 if (name !== route.name) changed.push({ ...route, name });
1062 }
1063 return changed;
1064 },
1065
1066 resolve(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null {
1067 const layout = LAYOUT_REF.exec(ref.referenceName);

Callers

nothing calls this directly

Calls 7

angularMountsFunction · 0.85
prefixOfFunction · 0.85
inFilePathFunction · 0.85
pushMethod · 0.80
joinPathFunction · 0.70
resolvedFunction · 0.70
getNodesByKindMethod · 0.65

Tested by

no test coverage detected