diff --git a/dev.ts b/dev.ts index 0d0ffc6..1ac6425 100644 --- a/dev.ts +++ b/dev.ts @@ -23,4 +23,4 @@ void connect({ process.env.SHORTENER_BASE_URL = `${url}/s` require('./src/index') -}) \ No newline at end of file +}) diff --git a/src/transport/ProcessInboundMessage.ts b/src/transport/ProcessInboundMessage.ts index 0c10205..07756c0 100644 --- a/src/transport/ProcessInboundMessage.ts +++ b/src/transport/ProcessInboundMessage.ts @@ -19,5 +19,5 @@ export async function processInboundMessage(req: Request, res: Response, agent: if (!res.headersSent) { res.status(500).send('Error processing message') } - } + } } diff --git a/src/transport/SocketIdManager.ts b/src/transport/SocketIdManager.ts index bb242d7..7174ac7 100644 --- a/src/transport/SocketIdManager.ts +++ b/src/transport/SocketIdManager.ts @@ -1,33 +1,30 @@ - - class SocketIdsManager { - private active_connections : Record = {} + private active_connections: Record = {} - private static instance: SocketIdsManager; + private static instance: SocketIdsManager - private constructor() {} + private constructor() {} - public static getInstance() : SocketIdsManager { - if(!SocketIdsManager.instance){ - SocketIdsManager.instance = new SocketIdsManager() - } - return SocketIdsManager.instance; + public static getInstance(): SocketIdsManager { + if (!SocketIdsManager.instance) { + SocketIdsManager.instance = new SocketIdsManager() } - - public addSocketId(socketId:string) : string { - this.active_connections[socketId] = socketId; - return socketId; - } - - public removeSocketId(socketId : string) : string { - delete this.active_connections[socketId] - return socketId; - } - - public getConnectionBySocketId(socketId : string) : any { - return this.active_connections[socketId] - } - + return SocketIdsManager.instance + } + + public addSocketId(socketId: string): string { + this.active_connections[socketId] = socketId + return socketId + } + + public removeSocketId(socketId: string): string { + delete this.active_connections[socketId] + return socketId + } + + public getConnectionBySocketId(socketId: string): any { + return this.active_connections[socketId] + } } -export { SocketIdsManager} \ No newline at end of file +export { SocketIdsManager }