* Trim empty lines from the front and back of a line array.
(lines: LineRecord[])
| 169 | * Trim empty lines from the front and back of a line array. |
| 170 | */ |
| 171 | function trimEmptyLines(lines: LineRecord[]): void { |
| 172 | // Trim from front |
| 173 | while (lines.length > 0 && lines[0].isBlank) { |
| 174 | lines.shift() |
| 175 | } |
| 176 | // Trim from back |
| 177 | while (lines.length > 0 && lines[lines.length - 1].isBlank) { |
| 178 | lines.pop() |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | /** |
| 183 | * Find the file header (imports, top-level comments, etc.). |
no test coverage detected