json¶
JSON values are mapped to Minilang as follows:
null↔niltrue↔truefalse↔falseinteger ↔
integerreal ↔
realstring ↔
stringarray ↔
listobject ↔
map
meth json::decode(Json: address): anyDecodes
Jsoninto a Minilang value.meth json::encode(Value: any): string | errorEncodes
Valueinto JSON, raising an error ifValuecannot be represented as JSON.type json < stringContains a JSON encoded value. Primarily used to distinguish strings containing JSON from other strings (e.g. for CBOR encoding).
fun json(Value: any): jsonEncodes
Valueinto JSON.meth (Json: json):decode: any | errorDecodes the JSON string in
Jsoninto a Minilang value.meth (Json: json):value: any | errorDecodes the JSON string in
Jsoninto a Minilang value.type json::decoder < streamA JSON decoder that can be written to as a stream and calls a user-supplied callback whenever a complete value is decoded.
meth json::decoder(Callback: function): json::decoderReturns a new JSON decoder that calls
Callback(Value)whenever a complete JSON value is written to the decoder.meth json::decoder(Skip: string, Callback: function): json::decoderReturns a new JSON decoder that calls
Callback(Value)whenever a complete JSON value is written to the decoder.meth json::decode(Stream: stream): anyDecodes the content of
Jsoninto a Minilang value.meth json::encode(Buffer: string::buffer, Value: any)TBD