mirror of https://github.com/jkjoy/sunpeiwen.git
12 lines
356 B
JavaScript
12 lines
356 B
JavaScript
|
"use strict";
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
const normalizeValue = (value) => String(value)
|
||
|
.replace(/\r|\n/g, (match, i, str) => {
|
||
|
if ((match === "\r" && str[i + 1] !== "\n")
|
||
|
|| (match === "\n" && str[i - 1] !== "\r")) {
|
||
|
return "\r\n";
|
||
|
}
|
||
|
return match;
|
||
|
});
|
||
|
exports.default = normalizeValue;
|