Skip to content

renderJson

renderJson(value, pretty?) → string · Format

Serialize a UDM value to a JSON string. See Chapter 24.

  • value (required): UDM value to serialize

  • pretty (optional, default false): pretty-print with indentation

utlx
renderJson({name: "Alice", age: 30})        // '{"name":"Alice","age":30}'
renderJson({name: "Alice", age: 30}, true)  // pretty-printed with newlines

Released under AGPL-3.0.