(text: string, ending: "\n" | "\r\n")
| 342 | const alt = "alpha\nbeta\nomega" |
| 343 | |
| 344 | const normalize = (text: string, ending: "\n" | "\r\n") => { |
| 345 | const normalized = text.replaceAll("\r\n", "\n") |
| 346 | if (ending === "\n") return normalized |
| 347 | return normalized.replaceAll("\n", "\r\n") |
| 348 | } |
| 349 | |
| 350 | const count = (content: string) => { |
| 351 | const crlf = content.match(/\r\n/g)?.length ?? 0 |