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

Function parseArrayField

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

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

Callers 2

parseRouteObjectsFunction · 0.85
parseControllersFieldFunction · 0.85

Calls 2

matchingCloseFunction · 0.85
execMethod · 0.65

Tested by

no test coverage detected