(str)
| 1 | export function normalizeNewlines(str) { |
| 2 | // remove all <CR> |
| 3 | str = str.replace(/\r/g, '') |
| 4 | // no extra newlines up front |
| 5 | str = str.replace(/^\n+/, '') |
| 6 | // and a single newline at the end |
| 7 | str = str.replace(/\n+$/, '') + '\n' |
| 8 | return str |
| 9 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…