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

Function parseArrayField

src/resolution/frameworks/nestjs.ts:758–766  ·  view source on GitHub ↗

Read an array-valued field — `key: [ ... ]` — as the raw inner text.

(obj: string, name: string)

Source from the content-addressed store, hash-verified

756
757/** Read an array-valued field — `key: [ ... ]` — as the raw inner text. */
758function parseArrayField(obj: string, name: string): string | null {
759 const re = new RegExp(`(?:^|[,{\\s])${name}\\s*:\\s*\\[`);
760 const m = re.exec(obj);
761 if (!m) return null;
762 const open = m.index + m[0].length - 1;
763 const close = matchingClose(obj, open);
764 if (close < 0) return null;
765 return obj.slice(open + 1, close);
766}

Callers 2

parseRouteObjectsFunction · 0.85
parseControllersFieldFunction · 0.85

Calls 2

matchingCloseFunction · 0.85
execMethod · 0.65

Tested by

no test coverage detected