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

Function parseRoutesArray

src/resolution/frameworks/nestjs.ts:777–784  ·  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

775 * practice; the registration is usually inline).
776 */
777function 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
786function parseRouteObjects(s: string): RouteItem[] {
787 const items: RouteItem[] = [];

Callers 1

Calls 2

matchingCloseFunction · 0.85
parseRouteObjectsFunction · 0.85

Tested by

no test coverage detected