From d1bbf244168aad55e1d467add0416aedd7f9e281 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Mon, 16 Aug 2021 09:31:54 +0200 Subject: [PATCH] [minor] Add `WebSocket.WebSocket{,Server}` aliases Add `WebSocket.WebSocket` as an alias for `WebSocket` and `WebSocket.WebSocketServer` as an alias for `WebSocket.Server` to fix name consistency and improve interoperability with the ES module wrapper. Refs: https://github.com/websockets/ws/issues/1877 Refs: https://github.com/websockets/ws/issues/1932 --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index 722c78676..41edb3b81 100644 --- a/index.js +++ b/index.js @@ -7,4 +7,7 @@ WebSocket.Server = require('./lib/websocket-server'); WebSocket.Receiver = require('./lib/receiver'); WebSocket.Sender = require('./lib/sender'); +WebSocket.WebSocket = WebSocket; +WebSocket.WebSocketServer = WebSocket.Server; + module.exports = WebSocket;