Ver Fonte

fix : issues #1732

gtoxlili há 1 ano atrás
pai
commit
ed14a0029a
1 ficheiros alterados com 5 adições e 2 exclusões
  1. 5 2
      app/utils/format.ts

+ 5 - 2
app/utils/format.ts

@@ -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");
 }