The offset of a field's value, from the offset of its key.
(s: string, keyAt: number)
| 152 | |
| 153 | /** The offset of a field's value, from the offset of its key. */ |
| 154 | function valueAfterKey(s: string, keyAt: number): number { |
| 155 | return keyAt + (/^[A-Za-z_$][\w$]*\s*:\s*/.exec(s.slice(keyAt, keyAt + 128))?.[0].length ?? 0); |
| 156 | } |
| 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 { |
no test coverage detected