const port = 8080
const wss = new WebSocketServer({ port }, () => {
console.info(
- `⚡️[ws server]: WebSocket server is started at ws://localhost:${port}/`
+ `⚡️[ws server]: WebSocket server is started at ws://localhost:${port.toString()}/`
)
})
ws.send(
JSON.stringify({
type: MessageType.echo,
- data: response.data
+ data: response.data,
})
)
return undefined
JSON.stringify(
{
type: MessageType.factorial,
- data: response.data
+ data: response.data,
},
- (_, v) => (typeof v === 'bigint' ? v.toString() : v)
+ (_, v: unknown) => (typeof v === 'bigint' ? v.toString() : v)
)
)
return undefined