@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.
@@ -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
- const absentUsers = recipients.filter((user) => !allUsers.includes(user));
244
- if (absentUsers.length > 0) {
245
- throw new pondError_1.ChannelError(`ChannelEngine: Users ${absentUsers.join(', ')} are not in channel ${this.name}`, 400, this.name);
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eleven-am/pondsocket",
3
- "version": "0.1.58",
3
+ "version": "0.1.59",
4
4
  "description": "PondSocket is a fast simple socket server",
5
5
  "keywords": [
6
6
  "socket",