MCPcopy Create free account
hub / github.com/effect-app/libs / safeToString

Function safeToString

repos/effect/packages/effect/src/Formatter.ts:233–240  ·  view source on GitHub ↗
(input: any)

Source from the content-addressed store, hash-verified

231 try {
232 const s = input.toString()
233 return typeof s === "string" ? s : String(s)
234 } catch {
235 return "[toString threw]"
236 }
237}
238
239/**
240 * Stringifies a value to JSON safely, silently dropping circular references.
241 *
242 * **When to use**
243 *

Callers 1

recurFunction · 0.85

Calls 2

StringInterface · 0.70
toStringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…