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

Function tanstackTable

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

Source from the content-addressed store, hash-verified

382const tables = new WeakMap<ResolutionContext, TanstackTable>();
383
384export function tanstackTable(context: ResolutionContext): TanstackTable {
385 const all = context.getNodesByKind('route');
386 const cached = tables.get(context);
387 if (cached && cached.source === all) return cached;
388 const byRoot = new Map<string, RouteTable>();
389 for (const node of all) {
390 if (!isTanstackRoute(node)) continue;
391 const root = appRootFor(node.filePath);
392 let t = byRoot.get(root);
393 if (!t) byRoot.set(root, (t = { source: all, exact: new Map(), dynamic: [] }));
394 addRouteTo(t, node.name, node);
395 }
396 const table: TanstackTable = { source: all, byRoot };
397 tables.set(context, table);
398 return table;
399}
400
401// =============================================================================
402// 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