* Parse a `[ {...}, {...} ]` argument list into a list of `RouteItem`s. The * args are expected to be an inline literal — references to a `const routes: * Routes = [...]` declared earlier in the file aren't followed (rare in * practice; the registration is usually inline).
(args: string)
| 775 | * practice; the registration is usually inline). |
| 776 | */ |
| 777 | function parseRoutesArray(args: string): RouteItem[] { |
| 778 | const trimmed = args.trim(); |
| 779 | if (!trimmed.startsWith('[')) return []; |
| 780 | // Strip outer [ ... ] respecting balanced brackets. |
| 781 | const close = matchingClose(trimmed, 0); |
| 782 | if (close < 0) return []; |
| 783 | return parseRouteObjects(trimmed.slice(1, close)); |
| 784 | } |
| 785 | |
| 786 | function parseRouteObjects(s: string): RouteItem[] { |
| 787 | const items: RouteItem[] = []; |
no test coverage detected