mirror of
https://git.mirrors.martin98.com/https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-07-25 03:14:30 +08:00
11 lines
240 B
TypeScript
11 lines
240 B
TypeScript
export function prettyObject(msg: any) {
|
|
const obj = msg;
|
|
if (typeof msg !== "string") {
|
|
msg = JSON.stringify(msg, null, " ");
|
|
}
|
|
if (msg === "{}") {
|
|
return obj.toString();
|
|
}
|
|
return ["```json", msg, "```"].join("\n");
|
|
}
|