@arcblock/ws 1.28.5 → 1.28.7
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/lib/client/index.js +1 -1
- package/lib/server/index.js +3 -5
- package/package.json +10 -10
- package/LICENSE +0 -13
package/lib/client/index.js
CHANGED
package/lib/server/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const EventEmitter = require('events');
|
|
2
|
-
const cluster = require('cluster');
|
|
1
|
+
const EventEmitter = require('node:events');
|
|
2
|
+
const cluster = require('node:cluster');
|
|
3
3
|
|
|
4
4
|
const get = require('lodash/get');
|
|
5
5
|
const WebSocket = require('ws');
|
|
@@ -171,12 +171,11 @@ class WsServer extends EventEmitter {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
// eslint-disable-next-line require-await
|
|
175
174
|
async _doBroadCast({ topic, event, data, enableLog, replyId, socketFilters } = {}) {
|
|
176
175
|
try {
|
|
177
176
|
let count = 0;
|
|
178
177
|
|
|
179
|
-
if (this.topics[topic]
|
|
178
|
+
if (this.topics[topic]?.size) {
|
|
180
179
|
let conditions = null;
|
|
181
180
|
if (socketFilters && Object.keys(socketFilters).length) {
|
|
182
181
|
conditions = Object.entries(socketFilters);
|
|
@@ -265,7 +264,6 @@ class WsServer extends EventEmitter {
|
|
|
265
264
|
/**
|
|
266
265
|
* private
|
|
267
266
|
*/
|
|
268
|
-
// eslint-disable-next-line require-await
|
|
269
267
|
async onWssConnection(socket) {
|
|
270
268
|
socket.id = nanoid();
|
|
271
269
|
socket.channel = {}; // This should be renamed to channels
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ws",
|
|
3
|
-
"version": "1.28.
|
|
3
|
+
"version": "1.28.7",
|
|
4
4
|
"description": "OCAP Chain websocket server and client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"websocket"
|
|
@@ -24,24 +24,24 @@
|
|
|
24
24
|
"type": "git",
|
|
25
25
|
"url": "git+https://github.com/ArcBlock/blockchain.git"
|
|
26
26
|
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"lint": "biome check",
|
|
29
|
+
"lint:fix": "biome check --write",
|
|
30
|
+
"test": "bun test",
|
|
31
|
+
"coverage": "npm run test -- --coverage"
|
|
32
|
+
},
|
|
27
33
|
"bugs": {
|
|
28
34
|
"url": "https://github.com/ArcBlock/blockchain/issues"
|
|
29
35
|
},
|
|
30
36
|
"dependencies": {
|
|
37
|
+
"@arcblock/event-hub": "1.28.7",
|
|
31
38
|
"debug": "^4.3.6",
|
|
32
39
|
"eventemitter3": "^4.0.7",
|
|
33
40
|
"lodash": "^4.17.21",
|
|
34
41
|
"phoenix": "1.7.2",
|
|
35
|
-
"ws": "^8.18.0"
|
|
36
|
-
"@arcblock/event-hub": "1.28.5"
|
|
42
|
+
"ws": "^8.18.0"
|
|
37
43
|
},
|
|
38
44
|
"devDependencies": {
|
|
39
45
|
"get-port": "^5.1.1"
|
|
40
|
-
},
|
|
41
|
-
"scripts": {
|
|
42
|
-
"lint": "eslint tests lib",
|
|
43
|
-
"lint:fix": "eslint --fix tests lib",
|
|
44
|
-
"test": "jest --forceExit --detectOpenHandles",
|
|
45
|
-
"coverage": "npm run test -- --coverage"
|
|
46
46
|
}
|
|
47
|
-
}
|
|
47
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Copyright 2018-2025 ArcBlock
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
|
|
7
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
|
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
See the License for the specific language governing permissions and
|
|
13
|
-
limitations under the License.
|