mirror of
https://github.com/hanzoai/prettier.git
synced 2026-09-24 17:02:04 +00:00
10 lines
233 B
JavaScript
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;
|