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

Function afterElement

src/resolution/frameworks/next-proxy.ts:159–168  ·  view source on GitHub ↗

The offset of the comma that ends the array element at `at`, or of the array's end.

(s: string, at: number, end: number)

Source from the content-addressed store, hash-verified

157
158/** The offset of the comma that ends the array element at `at`, or of the array's end. */
159function afterElement(s: string, at: number, end: number): number {
160 let i = at;
161 while (i > 0 && i < end && s[i] !== ',') {
162 const c = s[i]!;
163 if (c === '"' || c === "'" || c === '`') i = skipString(s, i) + 1;
164 else if (c === '{' || c === '[' || c === '(') i = matchBracket(s, i) + 1;
165 else i++;
166 }
167 return i;
168}
169
170/**
171 * Repeating parts one entry may carry, and how long it may be. Each repeat

Callers 1

readProxyMatcherFunction · 0.85

Calls 2

skipStringFunction · 0.90
matchBracketFunction · 0.90

Tested by

no test coverage detected