tur/json-string
stdlib/json-string.tur
owned String sibling for the tur/json encoder.
Since: v2 (string-adoption-stdlib-plan, batch 3)
defn
json/encode-string
(json/encode-string [node : int] :)
serialize a JSON node tree to an owned String.
Parameters
| node | a JSON node tree (as from json/decode or the json/* builders) |
Returns
An owned String holding the encoded JSON, safe to store or return.
Example
(string/to-cstr (json/encode-string (json/decode "{\"x\":1}")))
; => "{\"x\":1}"
Since: v2