(msg: any)
| 1 | export function prettyObject(msg: any) { |
| 2 | const obj = msg; |
| 3 | if (typeof msg !== "string") { |
| 4 | msg = JSON.stringify(msg, null, " "); |
| 5 | } |
| 6 | if (msg === "{}") { |
| 7 | return obj.toString(); |
| 8 | } |
| 9 | if (msg.startsWith("```json")) { |
| 10 | return msg; |
| 11 | } |
| 12 | return ["```json", msg, "```"].join("\n"); |
| 13 | } |
| 14 | |
| 15 | export function* chunks(s: string, maxBytes = 1000 * 1000) { |
| 16 | const decoder = new TextDecoder("utf-8"); |
no outgoing calls
no test coverage detected