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

Function scanRouteDeclarations

src/resolution/frameworks/react.ts:1032–1036  ·  view source on GitHub ↗

The routes a file's own text declares: its ` ` elements and, in a file that makes a router, its route objects.

(source: string, allowJsx: boolean)

Source from the content-addressed store, hash-verified

1030
1031/** The routes a file's own text declares: its `<Route>` elements and, in a file that makes a router, its route objects. */
1032function scanRouteDeclarations(source: string, allowJsx: boolean): RouteDeclaration[] {
1033 const objects = ROUTER_CALL.test(source);
1034 if (!objects && !/<Route\b/.test(source)) return [];
1035 return scanRoutes(source, allowJsx, { objects }).routes;
1036}
1037
1038/**
1039 * Structural scanner: strings, comments, JSX and balanced expressions are units.

Callers 1

extractFunction · 0.85

Calls 1

scanRoutesFunction · 0.85

Tested by

no test coverage detected