@depup/ws 8.21.3-depup.0 → 8.22.0-depup.0

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/README.md CHANGED
@@ -13,8 +13,8 @@ npm install @depup/ws
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [ws](https://www.npmjs.com/package/ws) @ 8.21.3 |
17
- | Processed | 2026-08-09 |
16
+ | Original | [ws](https://www.npmjs.com/package/ws) @ 8.22.0 |
17
+ | Processed | 2026-09-27 |
18
18
  | Smoke test | passed |
19
19
  | Deps updated | 0 |
20
20
 
package/changes.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "bumped": {},
3
- "timestamp": "2026-08-09T00:37:57.258Z",
3
+ "timestamp": "2026-09-27T01:06:06.668Z",
4
4
  "totalUpdated": 0
5
5
  }
package/lib/websocket.js CHANGED
@@ -75,11 +75,24 @@ class WebSocket extends EventEmitter {
75
75
  this._redirects = 0;
76
76
 
77
77
  if (protocols === undefined) {
78
- protocols = [];
78
+ if (!options || options.protocols === undefined) {
79
+ protocols = [];
80
+ } else if (Array.isArray(options.protocols)) {
81
+ protocols = options.protocols;
82
+ } else {
83
+ protocols = [options.protocols];
84
+ }
79
85
  } else if (!Array.isArray(protocols)) {
80
86
  if (typeof protocols === 'object' && protocols !== null) {
81
87
  options = protocols;
82
- protocols = [];
88
+
89
+ if (options.protocols === undefined) {
90
+ protocols = [];
91
+ } else if (Array.isArray(options.protocols)) {
92
+ protocols = options.protocols;
93
+ } else {
94
+ protocols = [options.protocols];
95
+ }
83
96
  } else {
84
97
  protocols = [protocols];
85
98
  }
@@ -318,7 +331,6 @@ class WebSocket extends EventEmitter {
318
331
  return;
319
332
  }
320
333
 
321
- this._readyState = WebSocket.CLOSING;
322
334
  this._sender.close(code, data, !this._isServer, (err) => {
323
335
  //
324
336
  // This error is handled by the `'error'` listener on the socket. We only
@@ -336,6 +348,7 @@ class WebSocket extends EventEmitter {
336
348
  }
337
349
  });
338
350
 
351
+ this._readyState = WebSocket.CLOSING;
339
352
  setCloseTimer(this);
340
353
  }
341
354
 
@@ -681,6 +694,7 @@ function initAsClient(websocket, address, protocols, options) {
681
694
  socketPath: undefined,
682
695
  hostname: undefined,
683
696
  protocol: undefined,
697
+ protocols: undefined,
684
698
  timeout: undefined,
685
699
  method: 'GET',
686
700
  host: undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depup/ws",
3
- "version": "8.21.3-depup.0",
3
+ "version": "8.22.0-depup.0",
4
4
  "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js (with updated dependencies)",
5
5
  "keywords": [
6
6
  "ws",
@@ -83,8 +83,8 @@
83
83
  "changes": {},
84
84
  "depsUpdated": 0,
85
85
  "originalPackage": "ws",
86
- "originalVersion": "8.21.3",
87
- "processedAt": "2026-08-09T00:37:59.600Z",
86
+ "originalVersion": "8.22.0",
87
+ "processedAt": "2026-09-27T01:06:09.117Z",
88
88
  "smokeTest": "passed"
89
89
  }
90
90
  }