The offset of the comma that ends the array element at `at`, or of the array's end.
(s: string, at: number, end: number)
| 157 | |
| 158 | /** The offset of the comma that ends the array element at `at`, or of the array's end. */ |
| 159 | function 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 |
no test coverage detected