Package: effect
Module: Inspectable
Converts a value to a JSON-serializable representation safely.
When to use
Use when you need a safe, JSON-serializable representation of a value without risking unhandled errors.
Details
This function attempts to extract JSON data from objects that implement the
toJSON method, recursively processes arrays, and handles errors gracefully.
For objects that don’t have a toJSON method, it applies redaction to
protect sensitive information.
See
toStringUnknown for converting unknown values to stringsSignature
declare const toJson: (input: unknown) => unknown
Since v4.0.0