fix stringify
This commit is contained in:
parent
acb6fe2c4b
commit
f18ce23cf9
2 changed files with 3 additions and 3 deletions
|
@ -75,7 +75,7 @@ var Methods: ([string, (req: Request, res: Response) => Promise<void>])[] = [
|
|||
} else {
|
||||
out += ` \x1b[1m\x1b[41m[${name}]: \x1b[0m\x1b[41m`;
|
||||
}
|
||||
out += args.map(a => `${typeof a == 'object' ? JSON.stringify(a) : a}`).join(" ");
|
||||
out += args.map(a => `${typeof a == 'object' ? JSON.stringify(a, (k, v) => typeof v == "bigint" ? Number(v) : v) : a}`).join(" ");
|
||||
out += "\x1b[0m";
|
||||
return out;
|
||||
}).join("\x1b[0m\n"));
|
||||
|
|
|
@ -48,7 +48,7 @@ export class wsClient {
|
|||
debug("WebSocket", "send:", "error", "closed");
|
||||
return;
|
||||
}
|
||||
if(!bruteforcecheck(this.client.ip)){
|
||||
if (!bruteforcecheck(this.client.ip)) {
|
||||
socket.send(JSON.stringify({
|
||||
id: json.id,
|
||||
state: "error",
|
||||
|
@ -117,7 +117,7 @@ export class wsClient {
|
|||
try {
|
||||
await func(this.client, json.data, (state, data = "") => {
|
||||
debug("WebSocket", "send:", state, data);
|
||||
socket.send(JSON.stringify({ id: json.id, state, data }));
|
||||
socket.send(JSON.stringify({ id: json.id, state, data }, (k, v) => typeof v == "bigint" ? Number(v) : v));
|
||||
send = true;
|
||||
});
|
||||
} catch (e) {
|
||||
|
|
Loading…
Reference in a new issue