Jsont_brrSourceJavaScript support.
Note. These functions incur a bit of overhead but should work fast enough for medium sized structures. Get in touch if you run into problems, some improvements may be possible.
The JSON functions use JavaScript's JSON.parse and JSON.stringify to convert to JavaScript values which are then converted with decode_jv and encode_jv. Parse locations and layout preservation are unsupported.
decode t s decodes the JSON data s according to t.
decode' t s is like decode but preserves the error structure.
decode_jv t v decodes the JavaScript value v according to t.
decode_jv' is like decode_jv' but preserves the error structure.
encode t v encodes v to JSON according to t. format specifies how the JSON is formatted, defaults to Jsont.format.Minify. The Jsont.format.Layout format is unsupported, Jsont.format.Indent is used instead.
encode' is like encode but preserves the error structure. format specifies how the JSON is formatted, defaults to Jsont.format.Minify. The Jsont.format.Layout format is unsupported, Jsont.format.Indent is used instead.
encode_jv t v encodes v to a JavaScript value according to t.
encode_jv' is like encode_jv but preserves the error structure.
recode is decode_jv' followed by encode_jv'.