(content: string)
| 161 | // Checks if every line in the content has line numbers prefixed (e.g., "1 | content" or "123 | content") |
| 162 | // Line numbers must be followed by a single pipe character (not double pipes) |
| 163 | export function everyLineHasLineNumbers(content: string): boolean { |
| 164 | const lines = content.split(/\r?\n/) // Handles both CRLF (carriage return (\r) + line feed (\n)) and LF (line feed (\n)) line endings |
| 165 | return lines.length > 0 && lines.every((line) => /^\s*\d+\s+\|(?!\|)/.test(line)) |
| 166 | } |
| 167 | |
| 168 | /** |
| 169 | * Strips line numbers from content while preserving the actual content. |
no outgoing calls
no test coverage detected