forked from XiaoMo/ChatGPT-Next-Web
fix : issues #1732
This commit is contained in:
parent
8874c687d8
commit
ed14a0029a
@ -1,7 +1,10 @@
|
||||
export function prettyObject(msg: any) {
|
||||
const obj = msg;
|
||||
if (typeof msg !== "string") {
|
||||
msg = JSON.stringify(msg, null, " ");
|
||||
}
|
||||
const prettyMsg = ["```json", msg, "```"].join("\n");
|
||||
return prettyMsg;
|
||||
if (msg === "{}") {
|
||||
return obj.toString();
|
||||
}
|
||||
return ["```json", msg, "```"].join("\n");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user