Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: spelling mistakes #7883

Merged
merged 1 commit into from Apr 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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