@arcblock/ws 1.18.87 → 1.18.88

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,13 +1,14 @@
1
1
  const EventEmitter = require('events');
2
2
  const cluster = require('cluster');
3
3
 
4
- const { nanoid } = require('nanoid');
5
4
  const get = require('lodash/get');
6
5
  const WebSocket = require('ws');
7
6
  const eventHub = cluster.isMaster ? require('@arcblock/event-hub/single') : require('@arcblock/event-hub');
8
7
 
9
8
  const createLogger = require('../logger');
10
9
 
10
+ const nanoid = (length = 16) => [...Array(length)].map(() => Math.random().toString(36)[2]).join('');
11
+
11
12
  const sleep = (timeout) =>
12
13
  new Promise((resolve) => {
13
14
  setTimeout(resolve, timeout);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ws",
3
- "version": "1.18.87",
3
+ "version": "1.18.88",
4
4
  "description": "OCAP Chain websocket server and client",
5
5
  "keywords": [
6
6
  "websocket"
@@ -34,16 +34,15 @@
34
34
  "url": "https://github.com/ArcBlock/asset-chain/issues"
35
35
  },
36
36
  "dependencies": {
37
- "@arcblock/event-hub": "1.18.87",
37
+ "@arcblock/event-hub": "1.18.88",
38
38
  "debug": "^4.3.4",
39
39
  "eventemitter3": "^4.0.7",
40
40
  "lodash": "^4.17.21",
41
- "nanoid": "~3.3.4",
42
41
  "phoenix": "1.7.2",
43
42
  "ws": "^8.9.0"
44
43
  },
45
44
  "devDependencies": {
46
45
  "get-port": "^5.1.1"
47
46
  },
48
- "gitHead": "1b55426d58e13105009cc571a5f00be36dc38900"
47
+ "gitHead": "ab1df2e118a55d3e0350ee45f2927342ae0e17b3"
49
48
  }