The full source line containing `index`, trimmed and capped for display.
(text: string, index: number)
| 390 | |
| 391 | /** The full source line containing `index`, trimmed and capped for display. */ |
| 392 | function snippetAround(text: string, index: number): string { |
| 393 | const lineStart = text.lastIndexOf('\n', index) + 1; |
| 394 | let lineEnd = text.indexOf('\n', index); |
| 395 | if (lineEnd === -1) lineEnd = text.length; |
| 396 | const line = text.slice(lineStart, lineEnd).trim(); |
| 397 | return line.length > 120 ? line.slice(0, 117) + '...' : line; |
| 398 | } |
no outgoing calls
no test coverage detected