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

Function parseArrayField

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

980
981/** Read an array-valued field — `key: [ ... ]` — as the raw inner text. */
982function parseArrayField(obj: string, name: string): string | null {
983 const re = new RegExp(`(?:^|[,{\\s])${name}\\s*:\\s*\\[`);
984 const m = re.exec(obj);
985 if (!m) return null;
986 const open = m.index + m[0].length - 1;
987 const close = matchingClose(obj, open);
988 if (close < 0) return null;
989 return obj.slice(open + 1, close);
990}

Callers 2

parseRouteObjectsFunction · 0.85
parseControllersFieldFunction · 0.85

Calls 2

matchingCloseFunction · 0.85
execMethod · 0.65

Tested by

no test coverage detected