Skip to content

Commit

Permalink
fix: the display format of json
Browse files Browse the repository at this point in the history
  • Loading branch information
yanCode committed May 31, 2023
1 parent c198c33 commit 6bbdaf7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/utils/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ export function prettyObject(msg: any) {
if (msg === "{}") {
return obj.toString();
}
if (msg.startsWith("```json")) {
return msg;
}
return ["```json", msg, "```"].join("\n");
}

0 comments on commit 6bbdaf7

Please sign in to comment.