(input: any)
| 217 | } |
| 218 | |
| 219 | function safeToString(input: any): string { |
| 220 | try { |
| 221 | const s = input.toString() |
| 222 | return typeof s === "string" ? s : String(s) |
| 223 | } catch { |
| 224 | return "[toString threw]" |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | /** |
| 229 | * Stringifies a value to JSON safely, silently dropping circular references. |