(head: string, field: string)
| 821 | } |
| 822 | |
| 823 | function getTopLevelRawJsonStringField(head: string, field: string): string | null { |
| 824 | let i = 0 |
| 825 | while (i < head.length && /\s/.test(head[i]!)) i++ |
| 826 | if (head.charCodeAt(i) !== 0x7b) return null |
| 827 | i++ |
| 828 | while (i < head.length) { |
| 829 | while (i < head.length && /\s/.test(head[i]!)) i++ |
| 830 | if (head.charCodeAt(i) === 0x2c) { |
| 831 | i++ |
| 832 | continue |
| 833 | } |
| 834 | if (head.charCodeAt(i) === 0x7d) return null |
| 835 | if (head.charCodeAt(i) !== 0x22) return null |
| 836 | const keyEnd = findJsonStringEnd(head, i) |
| 837 | if (keyEnd === -1) return null |
| 838 | const key = head.slice(i + 1, keyEnd) |
| 839 | i = keyEnd + 1 |
| 840 | while (i < head.length && /\s/.test(head[i]!)) i++ |
| 841 | if (head.charCodeAt(i) !== 0x3a) return null |
| 842 | const value = findJsonValueBounds(head, i + 1) |
| 843 | if (!value) return null |
| 844 | if (key === field) return readJsonString(head, value) ?? null |
| 845 | i = value.end |
| 846 | } |
| 847 | return null |
| 848 | } |
| 849 | |
| 850 | export function shouldSkipLine(line: string, threshold: string): boolean { |
| 851 | const head = line.length > RAW_HEAD_BYTES ? line.slice(0, RAW_HEAD_BYTES) : line |
no test coverage detected