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

Function parseRoutesArray

src/resolution/frameworks/nestjs.ts:774–781  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

772 * practice; the registration is usually inline).
773 */
774function parseRoutesArray(args: string): RouteItem[] {
775 const trimmed = args.trim();
776 if (!trimmed.startsWith('[')) return [];
777 // Strip outer [ ... ] respecting balanced brackets.
778 const close = matchingClose(trimmed, 0);
779 if (close < 0) return [];
780 return parseRouteObjects(trimmed.slice(1, close));
781}
782
783function parseRouteObjects(s: string): RouteItem[] {
784 const items: RouteItem[] = [];

Callers 1

Calls 2

matchingCloseFunction · 0.85
parseRouteObjectsFunction · 0.85

Tested by

no test coverage detected