Bump prettier from 1.19.1 to 2.0.5 (#36)
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Panayiotis Lipiridis <lipiridis@gmail.com>
This commit is contained in:
parent
78ed62d438
commit
30ca342490
@ -29,7 +29,7 @@
|
|||||||
"eslint-config-prettier": "6.10.1",
|
"eslint-config-prettier": "6.10.1",
|
||||||
"eslint-plugin-prettier": "3.1.4",
|
"eslint-plugin-prettier": "3.1.4",
|
||||||
"express": "4.17.1",
|
"express": "4.17.1",
|
||||||
"prettier": "1.19.1",
|
"prettier": "2.0.5",
|
||||||
"socket.io": "2.3.0"
|
"socket.io": "2.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
12
src/index.ts
12
src/index.ts
@ -17,21 +17,21 @@ server.listen(port, () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const io = socketIO(server, {
|
const io = socketIO(server, {
|
||||||
handlePreflightRequest: function(req, res) {
|
handlePreflightRequest: function (req, res) {
|
||||||
var headers = {
|
var headers = {
|
||||||
"Access-Control-Allow-Headers": "Content-Type, Authorization",
|
"Access-Control-Allow-Headers": "Content-Type, Authorization",
|
||||||
"Access-Control-Allow-Origin": req.header ? req.header.origin : "*",
|
"Access-Control-Allow-Origin": req.header ? req.header.origin : "*",
|
||||||
"Access-Control-Allow-Credentials": true
|
"Access-Control-Allow-Credentials": true,
|
||||||
};
|
};
|
||||||
res.writeHead(200, headers);
|
res.writeHead(200, headers);
|
||||||
res.end();
|
res.end();
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
io.on("connection", socket => {
|
io.on("connection", (socket) => {
|
||||||
ioDebug("connection established!");
|
ioDebug("connection established!");
|
||||||
io.to(`${socket.id}`).emit("init-room");
|
io.to(`${socket.id}`).emit("init-room");
|
||||||
socket.on("join-room", roomID => {
|
socket.on("join-room", (roomID) => {
|
||||||
socketDebug(`${socket.id} has joined ${roomID}`);
|
socketDebug(`${socket.id} has joined ${roomID}`);
|
||||||
socket.join(roomID);
|
socket.join(roomID);
|
||||||
if (io.sockets.adapter.rooms[roomID].length <= 1) {
|
if (io.sockets.adapter.rooms[roomID].length <= 1) {
|
||||||
@ -67,7 +67,7 @@ io.on("connection", socket => {
|
|||||||
const rooms = io.sockets.adapter.rooms;
|
const rooms = io.sockets.adapter.rooms;
|
||||||
for (const roomID in socket.rooms) {
|
for (const roomID in socket.rooms) {
|
||||||
const clients = Object.keys(rooms[roomID].sockets).filter(
|
const clients = Object.keys(rooms[roomID].sockets).filter(
|
||||||
id => id !== socket.id
|
(id) => id !== socket.id
|
||||||
);
|
);
|
||||||
if (clients.length > 0) {
|
if (clients.length > 0) {
|
||||||
socket.broadcast.to(roomID).emit("room-user-change", clients);
|
socket.broadcast.to(roomID).emit("room-user-change", clients);
|
||||||
|
@ -1054,10 +1054,10 @@ prettier-linter-helpers@^1.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
fast-diff "^1.1.2"
|
fast-diff "^1.1.2"
|
||||||
|
|
||||||
prettier@1.19.1:
|
prettier@2.0.5:
|
||||||
version "1.19.1"
|
version "2.0.5"
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4"
|
||||||
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
|
integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==
|
||||||
|
|
||||||
progress@^2.0.0:
|
progress@^2.0.0:
|
||||||
version "2.0.3"
|
version "2.0.3"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user