@cloudpss/ubrpc 0.6.0-alpha.8 → 0.6.0-alpha.9

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/tests/server.ts +5 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudpss/ubrpc",
3
- "version": "0.6.0-alpha.8",
3
+ "version": "0.6.0-alpha.9",
4
4
  "author": "CloudPSS",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -19,8 +19,8 @@
19
19
  "dependencies": {
20
20
  "rxjs": "^7.8.2",
21
21
  "uuid": "^13.0.0",
22
- "@cloudpss/fetch": "~0.6.0-alpha.8",
23
- "@cloudpss/ubjson": "~0.6.0-alpha.8"
22
+ "@cloudpss/fetch": "~0.6.0-alpha.9",
23
+ "@cloudpss/ubjson": "~0.6.0-alpha.9"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/ws": "^8.18.1",
package/tests/server.ts CHANGED
@@ -5,18 +5,18 @@ const a = {
5
5
  greetings: 'Hello, ',
6
6
  /**
7
7
  * @inheritdoc
8
- * @param {string} name 名字
8
+ * @param name 名字
9
9
  */
10
- async hello(name) {
10
+ async hello(name: string) {
11
11
  console.log('hello', name);
12
12
  await Promise.resolve();
13
13
  return `${this.greetings}${name}`;
14
14
  },
15
15
  /**
16
16
  * @inheritdoc
17
- * @param {number | undefined} i 间隔
17
+ * @param i 间隔
18
18
  */
19
- timer(i) {
19
+ timer(i?: number) {
20
20
  return interval(i).pipe(
21
21
  take(10),
22
22
  tap({
@@ -43,7 +43,7 @@ const server = new WebSocketServer({
43
43
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
44
44
  server.on('connection', async (socket) => {
45
45
  try {
46
- await rpc.connect(socket);
46
+ await rpc.connect(socket as unknown as WebSocket);
47
47
  } catch (ex) {
48
48
  console.log(ex);
49
49
  }