(source: string, attachmentBounds: JsonValueBounds | null)
| 393 | } |
| 394 | |
| 395 | function extractLargeAddedNames(source: string, attachmentBounds: JsonValueBounds | null): string[] { |
| 396 | if (!attachmentBounds || attachmentBounds.kind !== 'object') return [] |
| 397 | const attachmentType = readJsonString(source, findObjectFieldValue(source, attachmentBounds.start, attachmentBounds.end, 'type')) |
| 398 | if (attachmentType !== 'deferred_tools_delta') return [] |
| 399 | const addedNames = findObjectFieldValue(source, attachmentBounds.start, attachmentBounds.end, 'addedNames') |
| 400 | if (!addedNames || addedNames.kind !== 'array') return [] |
| 401 | const names: string[] = [] |
| 402 | let i = addedNames.start + 1 |
| 403 | while (i < addedNames.end - 1 && names.length < MAX_ADDED_NAMES) { |
| 404 | while (i < addedNames.end && /\s/.test(source[i]!)) i++ |
| 405 | if (source.charCodeAt(i) === 0x2c) { |
| 406 | i++ |
| 407 | continue |
| 408 | } |
| 409 | if (source.charCodeAt(i) !== 0x22) { |
| 410 | i++ |
| 411 | continue |
| 412 | } |
| 413 | const end = findJsonStringEnd(source, i, addedNames.end) |
| 414 | if (end === -1) break |
| 415 | const name = readJsonString(source, { start: i, end: end + 1, kind: 'string' }, 500) |
| 416 | if (name) names.push(name) |
| 417 | i = end + 1 |
| 418 | } |
| 419 | return names |
| 420 | } |
| 421 | |
| 422 | function parseLargeJsonlLine(line: string): JournalEntry | null { |
| 423 | const rootEnd = findJsonContainerEnd(line, 0, 0x7b, 0x7d) |
no test coverage detected