(line: string)
| 160 | let truncatedByBytes = false |
| 161 | |
| 162 | function tryPush(line: string): boolean { |
| 163 | if (truncateAtBytes !== undefined) { |
| 164 | const sep = selectedLines.length > 0 ? 1 : 0 |
| 165 | const nextBytes = selectedBytes + sep + Buffer.byteLength(line) |
| 166 | if (nextBytes > truncateAtBytes) { |
| 167 | truncatedByBytes = true |
| 168 | return false |
| 169 | } |
| 170 | selectedBytes = nextBytes |
| 171 | } |
| 172 | selectedLines.push(line) |
| 173 | return true |
| 174 | } |
| 175 | |
| 176 | while ((newlinePos = text.indexOf('\n', startPos)) !== -1) { |
| 177 | if (lineIndex >= offset && lineIndex < endLine && !truncatedByBytes) { |
no test coverage detected