Skip to content

Commit 35515f7

Browse files
bjnewmanBenjamin Newman
andauthored
feat: drop node v14/v16/v18, update to es2022, remove req.connection (#1162)
Co-authored-by: Benjamin Newman <benjaminnewman@Benjamins-Laptop.local>
1 parent 42d25d4 commit 35515f7

3 files changed

Lines changed: 3 additions & 7 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"patch-package/**/tmp": "^0.2.4"
100100
},
101101
"engines": {
102-
"node": "^14.18.0 || ^16.10.0 || >=18.0.0"
102+
"node": ">=20.0.0"
103103
},
104104
"commitlint": {
105105
"extends": [

src/http-proxy-middleware.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,8 @@ export class HttpProxyMiddleware<TReq, TRes> {
9090
/**
9191
* Get the server object to subscribe to server events;
9292
* 'upgrade' for websocket and 'close' for graceful shutdown
93-
*
94-
* NOTE:
95-
* req.socket: node >= 13
96-
* req.connection: node < 13 (Remove this when node 12/13 support is dropped)
9793
*/
98-
const server: https.Server = ((req.socket ?? req.connection) as any)?.server;
94+
const server: https.Server = (req.socket as any)?.server;
9995

10096
if (server && !this.serverOnCloseSubscribed) {
10197
server.on('close', () => {

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"lib": ["es2021", "es2022"],
66
"module": "commonjs",
77
"moduleResolution": "node",
8-
"target": "es2021",
8+
"target": "es2022",
99
"incremental": true,
1010
"declaration": true,
1111
"strict": true,

0 commit comments

Comments
 (0)