Truncate any value to a compact JSON preview.
(value: unknown, limit: number)
| 142 | |
| 143 | /** Truncate any value to a compact JSON preview. */ |
| 144 | function truncateValue(value: unknown, limit: number): string { |
| 145 | const text = typeof value === "string" ? value : compactJson(value) |
| 146 | if (text.length <= limit) return text |
| 147 | return text.slice(0, limit) + "..." |
| 148 | } |
no test coverage detected