(text: TextLines)
| 278 | |
| 279 | /** The lines joined with the file's own line break, ending with one; no trailing blank lines. */ |
| 280 | export function joinText(text: TextLines): string { |
| 281 | const lines = [...text.lines]; |
| 282 | while (lines.length > 0 && (lines[lines.length - 1] ?? '').trim() === '') lines.pop(); |
| 283 | return lines.length === 0 ? '' : lines.join(text.eol) + text.eol; |
| 284 | } |
| 285 | |
| 286 | /** One marker-delimited block: `start` is the start marker's offset, `end` is just past the end marker. */ |
| 287 | interface MarkedSection { |
no test coverage detected