Commit 060a4c2
authored
refactor: Import
Updates the `dht` package’s `WebsocketServer` to correctly use the named
`WebSocketServer` export introduced in ws v8+, improving clarity and
type consistency.
> [!NOTE]
> The current `WebSocket.Server` way works as long as we target CJS and
not ESM. The new way works for both.
### Changes
- Updated `WebsocketServer.ts` (mind the low-key "s") to import the
server using the proper `import { WebSocketServer } from 'ws'` syntax,
distinguishing it from the WebSocket client type.
- Replaced all `WebSocket.Server` type references and instantiations
with `WebSocketServer` for consistent and accurate typing.WebSocketServer properly (#3290)1 parent 20babce commit 060a4c2
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
0 commit comments