@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.js
CHANGED
|
@@ -169,11 +169,7 @@ function setLogger(logger) {
|
|
|
169
169
|
if (logger) current = logger;
|
|
170
170
|
}
|
|
171
171
|
function escapeLineBreaks(value) {
|
|
172
|
-
return value.replace(/
|
|
173
|
-
if (ch === "\n") return "\\n";
|
|
174
|
-
if (ch === "\r") return "\\r";
|
|
175
|
-
return `\\u${ch.charCodeAt(0).toString(16).padStart(4, "0")}`;
|
|
176
|
-
});
|
|
172
|
+
return value.replace(/\\/g, "\\\\").replace(/\r/g, "\\r").replace(/\n/g, "\\n").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
177
173
|
}
|
|
178
174
|
function scrub(args) {
|
|
179
175
|
return args.map((arg) => typeof arg === "string" ? escapeLineBreaks(arg) : arg);
|