mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 09:23:57 +08:00
fix : issues #1732
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
Reference in New Issue
Block a user