@emeryld/rrroutes-server 2.5.2 → 2.5.4
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 +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/routesV3.server.sanitize.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -66,7 +66,7 @@ var normalizeOptions = (options) => {
|
|
|
66
66
|
targets: new Set(options.targets ?? defaultTargets),
|
|
67
67
|
trimStrings: options.trimStrings ?? false,
|
|
68
68
|
stripNullBytes: options.stripNullBytes ?? true,
|
|
69
|
-
|
|
69
|
+
stripBlockedKeys: options.stripBlockedKeys ?? true,
|
|
70
70
|
blockedKeys: new Set(options.blockedKeys ?? defaultBlockedKeys),
|
|
71
71
|
maxDepth: options.maxDepth ?? defaultMaxDepth,
|
|
72
72
|
customSanitizer: options.customSanitizer,
|
|
@@ -122,7 +122,7 @@ var sanitizeValue = (value, options, depth, seen, req, target, path) => {
|
|
|
122
122
|
const source = value;
|
|
123
123
|
const objectTarget = Object.getPrototypeOf(source) === null ? /* @__PURE__ */ Object.create(null) : {};
|
|
124
124
|
for (const [key, entry] of Object.entries(source)) {
|
|
125
|
-
if (options.
|
|
125
|
+
if (options.stripBlockedKeys && options.blockedKeys.has(key)) {
|
|
126
126
|
continue;
|
|
127
127
|
}
|
|
128
128
|
;
|
|
@@ -1222,7 +1222,8 @@ function createSocketConnections(io, events, opts) {
|
|
|
1222
1222
|
sentAt: /* @__PURE__ */ new Date(),
|
|
1223
1223
|
sentTo: targets,
|
|
1224
1224
|
data: check.data,
|
|
1225
|
-
metadata: metadata ?? {}
|
|
1225
|
+
metadata: metadata ?? {},
|
|
1226
|
+
rooms: targets
|
|
1226
1227
|
};
|
|
1227
1228
|
if (targets.length === 0) io.emit(String(eventName), envelope);
|
|
1228
1229
|
else if (targets.length === 1) {
|