Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: spelling mistakes (#7883)
  • Loading branch information
jsyanyang committed Apr 25, 2022
1 parent 1f7855c commit 54728e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/vite/src/node/server/ws.ts
Expand Up @@ -149,7 +149,7 @@ export function createWebSocketServer(
if (!parsed || parsed.type !== 'custom' || !parsed.event) return
const listeners = customListeners.get(parsed.event)
if (!listeners?.size) return
const client = getSocketClent(socket)
const client = getSocketClient(socket)
listeners.forEach((listener) => listener(parsed.data, client))
})
socket.send(JSON.stringify({ type: 'connected' }))
Expand All @@ -170,7 +170,7 @@ export function createWebSocketServer(

// Provide a wrapper to the ws client so we can send messages in JSON format
// To be consistent with server.ws.send
function getSocketClent(socket: WebSocketRaw) {
function getSocketClient(socket: WebSocketRaw) {
if (!clientsMap.has(socket)) {
clientsMap.set(socket, {
send: (...args) => {
Expand Down Expand Up @@ -217,7 +217,7 @@ export function createWebSocketServer(
}) as WebSocketServer['off'],

get clients() {
return new Set(Array.from(wss.clients).map(getSocketClent))
return new Set(Array.from(wss.clients).map(getSocketClient))
},

send(...args: any[]) {
Expand Down

0 comments on commit 54728e3

Please sign in to comment.