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

Function tanstackTable

src/resolution/frameworks/tanstack-router.ts:305–320  ·  view source on GitHub ↗
(context: ResolutionContext)

Source from the content-addressed store, hash-verified

303const tables = new WeakMap<ResolutionContext, TanstackTable>();
304
305export function tanstackTable(context: ResolutionContext): TanstackTable {
306 const all = context.getNodesByKind('route');
307 const cached = tables.get(context);
308 if (cached && cached.source === all) return cached;
309 const byRoot = new Map<string, RouteTable>();
310 for (const node of all) {
311 if (!isTanstackRoute(node)) continue;
312 const root = appRootFor(node.filePath);
313 let t = byRoot.get(root);
314 if (!t) byRoot.set(root, (t = { source: all, exact: new Map(), dynamic: [] }));
315 addRouteTo(t, node.name, node);
316 }
317 const table: TanstackTable = { source: all, byRoot };
318 tables.set(context, table);
319 return table;
320}
321
322// =============================================================================
323// Navigation calls

Callers 2

tanstackLinkEdgesFunction · 0.90
resolveFunction · 0.85

Calls 6

appRootForFunction · 0.90
addRouteToFunction · 0.90
isTanstackRouteFunction · 0.85
getNodesByKindMethod · 0.65
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected