(content: string)
| 12 | const LF = '\n'; |
| 13 | |
| 14 | export function getEOL(content: string): string { |
| 15 | const newlines = content.match(/(?:\r?\n)/g); |
| 16 | |
| 17 | if (newlines?.length) { |
| 18 | const crlf = newlines.filter((l) => l === CRLF).length; |
| 19 | const lf = newlines.length - crlf; |
| 20 | |
| 21 | return crlf > lf ? CRLF : LF; |
| 22 | } |
| 23 | |
| 24 | return EOL; |
| 25 | } |
no test coverage detected