Skip to content

Commit 6877512

Browse files
refactor: upgrade to TypeScript 5
1 parent 56a53bc commit 6877512

File tree

6 files changed

+46
-26
lines changed

6 files changed

+46
-26
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
strategy:
1515
matrix:
1616
node-version:
17-
- 12
1817
- 20
1918

2019
steps:

lib/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import cluster = require("cluster");
1+
import cluster from "node:cluster";
22
import { Adapter, BroadcastOptions, Room } from "socket.io-adapter";
3-
import { randomBytes } from "crypto";
3+
import { randomBytes } from "node:crypto";
44

55
const randomId = () => randomBytes(8).toString("hex");
66
const debug = require("debug")("socket.io-cluster-adapter");
@@ -297,7 +297,7 @@ export class ClusterAdapter extends Adapter {
297297
message.nsp
298298
);
299299

300-
process.send(message, null, { swallowErrors: true }, ignoreError);
300+
process.send(message, null, {}, ignoreError);
301301
}
302302

303303
/**

package-lock.json

Lines changed: 38 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
"devDependencies": {
2828
"@types/expect.js": "^0.3.29",
2929
"@types/mocha": "^10.0.0",
30-
"@types/node": "^15.12.4",
30+
"@types/node": "~20.19.21",
3131
"expect.js": "0.3.1",
3232
"mocha": "^10.0.0",
3333
"nyc": "^15.1.0",
3434
"prettier": "^2.1.2",
3535
"socket.io": "^4.6.1",
3636
"socket.io-client": "^4.7.1",
3737
"ts-node": "^9.1.1",
38-
"typescript": "^4.0.5"
38+
"typescript": "~5.9.3"
3939
},
4040
"engines": {
4141
"node": ">=10.0.0"

test/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { io as ioc, Socket as ClientSocket } from "socket.io-client";
22
import expect = require("expect.js");
33
import { setupPrimary } from "..";
44
import { times, sleep } from "./util";
5-
import cluster = require("cluster");
6-
import { Worker } from "cluster";
5+
import cluster, { Worker } from "node:cluster";
76

87
const NODES_COUNT = 3;
98

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"allowJs": false,
55
"target": "es2017",
66
"module": "commonjs",
7-
"declaration": true
7+
"declaration": true,
8+
"esModuleInterop": true
89
},
910
"include": [
1011
"./lib/**/*"

0 commit comments

Comments
 (0)