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

Function parseIdentField

src/resolution/frameworks/nestjs.ts:978–982  ·  view source on GitHub ↗

Read an identifier-valued field — `key: SomeIdent` — out of one object body.

(obj: string, name: string)

Source from the content-addressed store, hash-verified

976
977/** Read an identifier-valued field — `key: SomeIdent` — out of one object body. */
978function parseIdentField(obj: string, name: string): string | null {
979 const re = new RegExp(`(?:^|[,{\\s])${name}\\s*:\\s*([A-Za-z_$][\\w$]*)`);
980 const m = obj.match(re);
981 return m ? m[1]! : null;
982}
983
984/** Read an array-valued field — `key: [ ... ]` — as the raw inner text. */
985function parseArrayField(obj: string, name: string): string | null {

Callers 1

parseRouteObjectsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected