(text)
| 662 | } |
| 663 | |
| 664 | function detectEol(text) { |
| 665 | if (typeof text !== 'string' || text.length === 0) return '\n' |
| 666 | return text.indexOf('\r\n') >= 0 ? '\r\n' : '\n' |
| 667 | } |
| 668 | |
| 669 | function normalizeEol(text, eol) { |
| 670 | const normalized = String(text || '').replace(/\r\n/g, '\n').replace(/\r/g, '\n') |