(source: Buffer, attachmentBounds: BufferJsonValueBounds | null)
| 738 | } |
| 739 | |
| 740 | function extractLargeAddedNamesBuffer(source: Buffer, attachmentBounds: BufferJsonValueBounds | null): string[] { |
| 741 | if (!attachmentBounds || attachmentBounds.kind !== 'object') return [] |
| 742 | const attachmentType = readJsonStringBuffer( |
| 743 | source, |
| 744 | findObjectFieldValueBuffer(source, attachmentBounds.start, attachmentBounds.end, 'type'), |
| 745 | ) |
| 746 | if (attachmentType !== 'deferred_tools_delta') return [] |
| 747 | const addedNames = findObjectFieldValueBuffer(source, attachmentBounds.start, attachmentBounds.end, 'addedNames') |
| 748 | if (!addedNames || addedNames.kind !== 'array') return [] |
| 749 | const names: string[] = [] |
| 750 | let i = addedNames.start + 1 |
| 751 | while (i < addedNames.end - 1 && names.length < MAX_ADDED_NAMES) { |
| 752 | while (i < addedNames.end && isJsonWhitespaceByte(source[i])) i++ |
| 753 | if (source[i] === 0x2c) { |
| 754 | i++ |
| 755 | continue |
| 756 | } |
| 757 | if (source[i] !== 0x22) { |
| 758 | i++ |
| 759 | continue |
| 760 | } |
| 761 | const end = findJsonStringEndBuffer(source, i, addedNames.end) |
| 762 | if (end === -1) break |
| 763 | const name = readJsonStringBuffer(source, { start: i, end: end + 1, kind: 'string' }, 500) |
| 764 | if (name) names.push(name) |
| 765 | i = end + 1 |
| 766 | } |
| 767 | return names |
| 768 | } |
| 769 | |
| 770 | function parseLargeJsonlBuffer(line: Buffer): JournalEntry | null { |
| 771 | let rootStart = 0 |
no test coverage detected