Files
test-repo/tests/config/format-test/consistent-end-of-line.js
T

10 lines
233 B
JavaScript

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