basic session management completed #11
@ -1,8 +1,7 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { deleteSession } from '@/src/managers/sessionManager';
|
import { deleteSession } from "@/src/managers/sessionManager";
|
||||||
|
|
||||||
const deleteSessionController: RequestHandler = (_req, res) => {
|
const deleteSessionController: RequestHandler = (_req, res) => {
|
||||||
|
|
||||||
//res.json({ sessionId: { $oid: "64768f104722f795300c9fc0" }, rewardSeed: 5867309943877621023 });
|
//res.json({ sessionId: { $oid: "64768f104722f795300c9fc0" }, rewardSeed: 5867309943877621023 });
|
||||||
deleteSession(_req.query.sessionId as string);
|
deleteSession(_req.query.sessionId as string);
|
||||||
res.sendStatus(200);
|
res.sendStatus(200);
|
||||||
|
@ -1,42 +1,28 @@
|
|||||||
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { getSession } from '@/src/managers/sessionManager';
|
import { getSession } from "@/src/managers/sessionManager";
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
|
|
||||||
const findSessionsController: RequestHandler = (_req, res) => {
|
const findSessionsController: RequestHandler = (_req, res) => {
|
||||||
|
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
console.log("FindSession Request:", JSON.parse(_req.body));
|
console.log("FindSession Request:", JSON.parse(_req.body));
|
||||||
let r = JSON.parse(_req.body);
|
let r = JSON.parse(_req.body);
|
||||||
if(r != undefined)
|
if (r != undefined) {
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
{
|
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
console.log("Found ID");
|
console.log("Found ID");
|
||||||
let s = getSession(r.id);
|
let s = getSession(r.id);
|
||||||
|
|
||||||
if(s)
|
if (s) res.json({ queryId: r.queryId, Sessions: s });
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
res.json({"queryId":r.queryId,"Sessions":s});
|
else res.json({});
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
else
|
} else if (r != undefined) {
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
res.json({});
|
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
}
|
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
else if(r != undefined)
|
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
{
|
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
console.log("Found OriginalSessionID");
|
console.log("Found OriginalSessionID");
|
||||||
|
|
||||||
let s = getSession(r.originalSessionId);
|
let s = getSession(r.originalSessionId);
|
||||||
if(s)
|
if (s) res.json({ queryId: r.queryId, Sessions: [s] });
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
res.json({"queryId":r.queryId,"Sessions":[s]});
|
else res.json({});
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
else
|
} else {
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
res.json({});
|
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
|
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
}
|
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
else
|
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
{
|
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
console.log("Found SessionRequest");
|
console.log("Found SessionRequest");
|
||||||
|
|
||||||
let s = getSession(_req.body);
|
let s = getSession(_req.body);
|
||||||
if(s)
|
if (s) res.json({ queryId: r.queryId, Sessions: [s] });
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
res.json({"queryId":r.queryId,"Sessions":[s]});
|
else res.json({});
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
else
|
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
res.json({});
|
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
}
|
}
|
||||||
|
|
||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
|
|||||||
};
|
};
|
||||||
|
|
||||||
export { findSessionsController };
|
export { findSessionsController };
|
||||||
|
|||||||
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() pls add curly braces everywhere pls add curly braces everywhere
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() useless case, already handled above. also would suggest removing the else and using a return useless case, already handled above. also would suggest removing the else and using a return
![]() Fixed this code Fixed this code
![]() Fixed this code Fixed this code
|
@ -8,6 +8,6 @@ function generateRewardSeed(): number {
|
|||||||
const min = -Number.MAX_SAFE_INTEGER;
|
const min = -Number.MAX_SAFE_INTEGER;
|
||||||
![]() not being used? not being used?
![]() Just for the moment. it is going to be used for seed generation I removed it while testing because i thought it was breaking my join requests Just for the moment. it is going to be used for seed generation I removed it while testing because i thought it was breaking my join requests
|
|||||||
const max = Number.MAX_SAFE_INTEGER;
|
const max = Number.MAX_SAFE_INTEGER;
|
||||||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||||
}
|
}
|
||||||
|
|
||||||
export { getNewRewardSeedController };
|
export { getNewRewardSeedController };
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { createNewSession } from '@/src/managers/sessionManager';
|
import { createNewSession } from "@/src/managers/sessionManager";
|
||||||
|
|
||||||
const hostSessionController: RequestHandler = (_req, res) => {
|
const hostSessionController: RequestHandler = (_req, res) => {
|
||||||
console.log("HostSession Request:", JSON.parse(_req.body));
|
console.log("HostSession Request:", JSON.parse(_req.body));
|
||||||
let session = createNewSession(JSON.parse(_req.body), _req.query.accountId as string);
|
let session = createNewSession(JSON.parse(_req.body), _req.query.accountId as string);
|
||||||
console.log("New Session Created: ", session);
|
console.log("New Session Created: ", session);
|
||||||
|
|
||||||
res.json({ sessionId: { $oid: session.sessionId }, rewardSeed:99999999 });
|
res.json({ sessionId: { $oid: session.sessionId }, rewardSeed: 99999999 });
|
||||||
};
|
};
|
||||||
|
|
||||||
export { hostSessionController };
|
export { hostSessionController };
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { getSessionByID } from '@/src/managers/sessionManager';
|
import { getSessionByID } from "@/src/managers/sessionManager";
|
||||||
|
|
||||||
const joinSessionController: RequestHandler = (_req, res) => {
|
const joinSessionController: RequestHandler = (_req, res) => {
|
||||||
|
|
||||||
console.log("JoinSession Request:", JSON.parse(_req.body));
|
console.log("JoinSession Request:", JSON.parse(_req.body));
|
||||||
let r = JSON.parse(_req.body);
|
let r = JSON.parse(_req.body);
|
||||||
let s = getSessionByID(r.sessionIds[0])
|
let s = getSessionByID(r.sessionIds[0]);
|
||||||
res.json({"rewardSeed":s?.rewardSeed,"sessionId":{"$oid":s?.sessionId}});
|
res.json({ rewardSeed: s?.rewardSeed, sessionId: { $oid: s?.sessionId } });
|
||||||
};
|
};
|
||||||
|
|
||||||
export { joinSessionController };
|
export { joinSessionController };
|
@ -1,13 +1,13 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { updateSession } from '@/src/managers/sessionManager';
|
import { updateSession } from "@/src/managers/sessionManager";
|
||||||
|
|
||||||
const updateSessionGetController: RequestHandler = (_req, res) => {
|
const updateSessionGetController: RequestHandler = (_req, res) => {
|
||||||
res.json({});
|
res.json({});
|
||||||
};
|
};
|
||||||
const updateSessionPostController: RequestHandler = (_req, res) => {
|
const updateSessionPostController: RequestHandler = (_req, res) => {
|
||||||
console.log("UpdateSessions POST Request:", JSON.parse(_req.body));
|
console.log("UpdateSessions POST Request:", JSON.parse(_req.body));
|
||||||
console.log("ReqID:",_req.query.sessionId as string)
|
console.log("ReqID:", _req.query.sessionId as string);
|
||||||
updateSession(_req.query.sessionId as string, _req.body)
|
updateSession(_req.query.sessionId as string, _req.body);
|
||||||
res.json({});
|
res.json({});
|
||||||
};
|
};
|
||||||
export { updateSessionGetController, updateSessionPostController };
|
export { updateSessionGetController, updateSessionPostController };
|
||||||
|
@ -24,11 +24,11 @@ interface Session {
|
|||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() redundant else redundant else
![]() invert if invert if
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
freePublic: number;
|
freePublic: number;
|
||||||
freePrivate: number;
|
freePrivate: number;
|
||||||
fullReset: number;
|
fullReset: number;
|
||||||
}
|
}
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
|
||||||
const sessions: Session[] = [];
|
const sessions: Session[] = [];
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
|
||||||
function createNewSession(sessionData: Session, Creator: string): Session {
|
function createNewSession(sessionData: Session, Creator: string): Session {
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
const sessionId = getNewSessionID();
|
const sessionId = getNewSessionID();
|
||||||
const newSession: Session = {
|
const newSession: Session = {
|
||||||
sessionId,
|
sessionId,
|
||||||
@ -44,46 +44,45 @@ interface Session {
|
|||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() redundant else redundant else
![]() invert if invert if
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
difficulty: sessionData.difficulty || 0,
|
difficulty: sessionData.difficulty || 0,
|
||||||
hasStarted: sessionData.hasStarted || false,
|
hasStarted: sessionData.hasStarted || false,
|
||||||
enableVoice: sessionData.enableVoice || true,
|
enableVoice: sessionData.enableVoice || true,
|
||||||
matchType: sessionData.matchType || 'NORMAL',
|
matchType: sessionData.matchType || "NORMAL",
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
maps: sessionData.maps || [],
|
maps: sessionData.maps || [],
|
||||||
originalSessionId: sessionData.originalSessionId || '',
|
originalSessionId: sessionData.originalSessionId || "",
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
customSettings: sessionData.customSettings || '',
|
customSettings: sessionData.customSettings || "",
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
rewardSeed: sessionData.rewardSeed || -1,
|
rewardSeed: sessionData.rewardSeed || -1,
|
||||||
guildId: sessionData.guildId || '',
|
guildId: sessionData.guildId || "",
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
buildId: sessionData.buildId || 4920386201513015989,
|
buildId: sessionData.buildId || 4920386201513015989,
|
||||||
platform: sessionData.platform || 0,
|
platform: sessionData.platform || 0,
|
||||||
xplatform: sessionData.xplatform || true,
|
xplatform: sessionData.xplatform || true,
|
||||||
freePublic: sessionData.freePublic || 3,
|
freePublic: sessionData.freePublic || 3,
|
||||||
freePrivate: sessionData.freePrivate || 0,
|
freePrivate: sessionData.freePrivate || 0,
|
||||||
fullReset:0,
|
fullReset: 0
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
};
|
};
|
||||||
sessions.push(newSession);
|
sessions.push(newSession);
|
||||||
return newSession;
|
return newSession;
|
||||||
}
|
}
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
|
||||||
function getAllSessions(): Session[] {
|
function getAllSessions(): Session[] {
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
return sessions;
|
return sessions;
|
||||||
}
|
}
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
|
||||||
function getSessionByID(sessionId: string): Session | undefined {
|
function getSessionByID(sessionId: string): Session | undefined {
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
return sessions.find(session => session.sessionId === sessionId);
|
return sessions.find(session => session.sessionId === sessionId);
|
||||||
}
|
}
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
|
||||||
|
interface FindSessionRequest {
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
interface FindSessionRequest {
|
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
|
||||||
function getSession(sessionIdOrRequest: string | FindSessionRequest): any[] {
|
function getSession(sessionIdOrRequest: string | FindSessionRequest): any[] {
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
if (typeof sessionIdOrRequest === 'string') {
|
if (typeof sessionIdOrRequest === "string") {
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
const session = sessions.find(session => session.sessionId === sessionIdOrRequest);
|
const session = sessions.find(session => session.sessionId === sessionIdOrRequest);
|
||||||
if (session) {
|
if (session) {
|
||||||
console.log("Found Sessions:",session)
|
console.log("Found Sessions:", session);
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
createdBy: session.creatorId,
|
createdBy: session.creatorId,
|
||||||
id: session.sessionId,
|
id: session.sessionId
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
},
|
}
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
@ -91,31 +90,31 @@ interface Session {
|
|||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() redundant else redundant else
![]() invert if invert if
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
const request = sessionIdOrRequest as FindSessionRequest;
|
const request = sessionIdOrRequest as FindSessionRequest;
|
||||||
const matchingSessions = sessions.filter(session => {
|
const matchingSessions = sessions.filter(session => {
|
||||||
for (const key in request) {
|
for (const key in request) {
|
||||||
if (key !== 'eloRating' && key !== 'queryId' && request[key] !== session[key as keyof Session]) {
|
if (key !== "eloRating" && key !== "queryId" && request[key] !== session[key as keyof Session]) {
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
![]() could remove this for loop and just use some type of UUID could remove this for loop and just use some type of UUID
![]() uuid package is really good, I can help to set it up. uuid package is really good, I can help to set it up.
|
|||||||
console.log("Found Matching Sessions:",matchingSessions)
|
console.log("Found Matching Sessions:", matchingSessions);
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
return matchingSessions.map(session => ({
|
return matchingSessions.map(session => ({
|
||||||
createdBy: session.creatorId,
|
createdBy: session.creatorId,
|
||||||
id: session.sessionId,
|
id: session.sessionId
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
|
||||||
function getSessionByCreatorID(creatorId: string): Session | undefined {
|
function getSessionByCreatorID(creatorId: string): Session | undefined {
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
return sessions.find(session => session.creatorId === creatorId);
|
return sessions.find(session => session.creatorId === creatorId);
|
||||||
}
|
}
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
|
||||||
function getNewSessionID(): string {
|
function getNewSessionID(): string {
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
const characters = '0123456789abcdef';
|
const characters = "0123456789abcdef";
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
const maxAttempts = 100;
|
const maxAttempts = 100;
|
||||||
let sessionId = '';
|
let sessionId = "";
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
|
||||||
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
||||||
sessionId = '64';
|
sessionId = "64";
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
for (let i = 0; i < 22; i++) {
|
for (let i = 0; i < 22; i++) {
|
||||||
const randomIndex = Math.floor(Math.random() * characters.length);
|
const randomIndex = Math.floor(Math.random() * characters.length);
|
||||||
sessionId += characters[randomIndex];
|
sessionId += characters[randomIndex];
|
||||||
@ -126,10 +125,10 @@ interface Session {
|
|||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() redundant else redundant else
![]() invert if invert if
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error('Failed to generate a unique session ID');
|
throw new Error("Failed to generate a unique session ID");
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
}
|
}
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
|
||||||
function updateSession(sessionId: string, sessionData: string): boolean {
|
function updateSession(sessionId: string, sessionData: string): boolean {
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
const session = sessions.find(session => session.sessionId === sessionId);
|
const session = sessions.find(session => session.sessionId === sessionId);
|
||||||
if (session) {
|
if (session) {
|
||||||
try {
|
try {
|
||||||
@ -137,21 +136,29 @@ interface Session {
|
|||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() redundant else redundant else
![]() invert if invert if
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
Object.assign(session, updatedData);
|
Object.assign(session, updatedData);
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Invalid JSON string for session update.');
|
console.error("Invalid JSON string for session update.");
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
|
||||||
function deleteSession(sessionId: string): boolean {
|
function deleteSession(sessionId: string): boolean {
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
const index = sessions.findIndex(session => session.sessionId === sessionId);
|
const index = sessions.findIndex(session => session.sessionId === sessionId);
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
sessions.splice(index, 1);
|
sessions.splice(index, 1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
export { createNewSession, getAllSessions, getSessionByID, getSessionByCreatorID, getNewSessionID, updateSession, deleteSession, getSession };
|
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
|
||||||
|
export {
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
createNewSession,
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
getAllSessions,
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
getSessionByID,
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
getSessionByCreatorID,
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
getNewSessionID,
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
updateSession,
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
deleteSession,
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
getSession
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
};
|
||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
|||||||
|
|||||||
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() move interface to another file like /types/session.ts move interface to another file like /types/session.ts
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() this is basically an 'any' type, could move it to another file an call it "LooseObject" this is basically an 'any' type, could move it to another file an call it "LooseObject"
![]() redundant else redundant else
![]() redundant else redundant else
![]() invert if invert if
![]() invert if invert if
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest not redundant, its a flip in the case depending on if the input is a string or a findSessionRequest
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
![]() i mean only the keyword is redundant. since you are returning in all cases inside the first if block. i mean only the keyword is redundant. since you are returning in all cases inside the first if block.
|
pls add curly braces everywhere
pls add curly braces everywhere
useless case, already handled above. also would suggest removing the else and using a return
useless case, already handled above. also would suggest removing the else and using a return
Fixed this code
Fixed this code