Files
test-repo/tests/config/utils/consistent-end-of-line.js
T
2022-01-04 17:00:25 +08:00

12 lines
250 B
JavaScript

function consistentEndOfLine(text) {
let firstEndOfLine;
return text.replace(/\r\n?|\n/g, (endOfLine) => {
if (!firstEndOfLine) {
firstEndOfLine = endOfLine;
}
return firstEndOfLine;
});
}
export default consistentEndOfLine;