@eleven-am/pondsocket 0.1.58 → 0.1.59
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/channel/channel.js +5 -3
- package/package.json +1 -1
package/channel/channel.js
CHANGED
|
@@ -240,9 +240,11 @@ _ChannelEngine_receiver = new WeakMap(), _ChannelEngine_presenceEngine = new Wea
|
|
|
240
240
|
users = allUsers.filter((user) => user !== sender);
|
|
241
241
|
break;
|
|
242
242
|
default:
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
if (!Array.isArray(recipients) || !recipients.every((recipient) => typeof recipient === 'string')) {
|
|
244
|
+
throw new pondError_1.ChannelError(`ChannelEngine: Invalid recipients ${recipients}`, 500, this.name);
|
|
245
|
+
}
|
|
246
|
+
if (recipients.some((user) => !allUsers.includes(user))) {
|
|
247
|
+
throw new pondError_1.ChannelError(`ChannelEngine: Invalid recipients ${recipients} some users do not exist in channel ${this.name}`, 500, this.name);
|
|
246
248
|
}
|
|
247
249
|
users = recipients;
|
|
248
250
|
break;
|