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

Function postExtract

src/resolution/frameworks/angular-router.ts:1055–1066  ·  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

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