debugObject()function

debugObject(value: object, depth = 1): string
ParamType
valueobject
The object to debug. required
depthunknown
How many levels of nested containers to expand (defaults to 1). Defaults to 1
Return
string
A human-readable string representation of the object.

Convert an object into a readable debug string.

  • Prefixes the constructor name for non-plain objects.
  • Expands entries down to depth levels.

Examples

debugObject({ a: 1 }) // `{\n\t"a": 1\n}`