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)
| 1030 | |
| 1031 | /** The routes a file's own text declares: its `<Route>` elements and, in a file that makes a router, its route objects. */ |
| 1032 | function 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. |