forked from XiaoMo/ChatGPT-Next-Web
8 lines
199 B
TypeScript
8 lines
199 B
TypeScript
export function prettyObject(msg: any) {
|
|
if (typeof msg !== "string") {
|
|
msg = JSON.stringify(msg, null, " ");
|
|
}
|
|
const prettyMsg = ["```json", msg, "```"].join("\n");
|
|
return prettyMsg;
|
|
}
|