diff --git a/src/index.ts b/src/index.ts index 65cc345..8b8b16b 100755 --- a/src/index.ts +++ b/src/index.ts @@ -80,9 +80,11 @@ try { socket.on("disconnecting", async () => { socketDebug(`${socket.id} has disconnected`); - for (const roomID in socket.rooms) { + for (const roomID of socket.rooms) { const otherClients = (await io.in(roomID).fetchSockets()).filter( - (_socket) => _socket.id !== socket.id, + (_socket) => { + return _socket.id !== socket.id; + }, ); if (otherClients.length > 0) { diff --git a/tsconfig.json b/tsconfig.json index a239fb1..c4007dc 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es5", + "target": "es2020", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true,