@onesub/server 0.23.1 → 0.23.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -176,11 +176,7 @@ function setLogger(logger) {
|
|
|
176
176
|
if (logger) current = logger;
|
|
177
177
|
}
|
|
178
178
|
function escapeLineBreaks(value) {
|
|
179
|
-
return value.replace(/
|
|
180
|
-
if (ch === "\n") return "\\n";
|
|
181
|
-
if (ch === "\r") return "\\r";
|
|
182
|
-
return `\\u${ch.charCodeAt(0).toString(16).padStart(4, "0")}`;
|
|
183
|
-
});
|
|
179
|
+
return value.replace(/\\/g, "\\\\").replace(/\r/g, "\\r").replace(/\n/g, "\\n").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
184
180
|
}
|
|
185
181
|
function scrub(args) {
|
|
186
182
|
return args.map((arg) => typeof arg === "string" ? escapeLineBreaks(arg) : arg);
|