MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / trimEmptyLines

Function trimEmptyLines

src/integrations/misc/indentation-reader.ts:171–180  ·  view source on GitHub ↗

* Trim empty lines from the front and back of a line array.

(lines: LineRecord[])

Source from the content-addressed store, hash-verified

169 * Trim empty lines from the front and back of a line array.
170 */
171function 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.).

Callers 1

readWithIndentationFunction · 0.85

Calls 1

popMethod · 0.80

Tested by

no test coverage detected