diff --git a/src/index.ts b/src/index.ts index 65cc345..c6d4720 100755 --- a/src/index.ts +++ b/src/index.ts @@ -80,7 +80,7 @@ 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, ); 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,