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

Function parseStringField

src/resolution/frameworks/nestjs.ts:968–972  ·  view source on GitHub ↗

* Read a string-valued field — `key: 'value'` — out of one object literal's * body. Returns `''` if not present. The leading character class guards * against matching a field whose name *contains* the target as a suffix.

(obj: string, name: string)

Source from the content-addressed store, hash-verified

966 * against matching a field whose name *contains* the target as a suffix.
967 */
968function parseStringField(obj: string, name: string): string {
969 const re = new RegExp(`(?:^|[,{\\s])${name}\\s*:\\s*['"\`]([^'"\`]*)['"\`]`);
970 const m = obj.match(re);
971 return m ? m[1]! : '';
972}
973
974/** Read an identifier-valued field — `key: SomeIdent` — out of one object body. */
975function parseIdentField(obj: string, name: string): string | null {

Callers 1

parseRouteObjectsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected