(line: string)
| 146 | let truncatedByBytes = false |
| 147 | |
| 148 | function tryPush(line: string): boolean { |
| 149 | if (truncateAtBytes !== undefined) { |
| 150 | const sep = selectedLines.length > 0 ? 1 : 0 |
| 151 | const nextBytes = selectedBytes + sep + Buffer.byteLength(line) |
| 152 | if (nextBytes > truncateAtBytes) { |
| 153 | truncatedByBytes = true |
| 154 | return false |
| 155 | } |
| 156 | selectedBytes = nextBytes |
| 157 | } |
| 158 | selectedLines.push(line) |
| 159 | return true |
| 160 | } |
| 161 | |
| 162 | while ((newlinePos = text.indexOf('\n', startPos)) !== -1) { |
| 163 | if (lineIndex >= offset && lineIndex < endLine && !truncatedByBytes) { |
no outgoing calls
no test coverage detected