velt/encoding/json
API referenceJSON is a global, as in JavaScript: it needs no import. JSON.parse<T>(text) decodes into a type you name and checks the text against it, JSON.stringify(x) writes any value with a JSON form as Node writes it, and JsonValue holds JSON whose shape you don't know. For a walkthrough, read the guide.
Exports
x as JSON.stringify writes a number (null for NaN and the infinities).appendJsonStringAppends s as a JSON string: quoted, with ", \, control characters and lone surrogates escaped.appendJsonUintAppends the decimal digits of an unsigned integer (every u64, unlike an f64).appendJsonValueAppends the JSON text of v (what v.stringify() returns), without making a string of it.writeJsonAppends what JSON.stringify(value) writes to w (one function per type, generated).ValueA JSON value of unknown shape: the prelude's JsonValue (docs/std/encoding/json.md).Re-exported from velt/encoding/json/append
function appendJsonNumber(out: StringBuilder, x: f64): voidAppends x as JSON.stringify writes a number (null for NaN and the infinities).
Re-exported from velt/encoding/json/append
function appendJsonString(out: StringBuilder, s: string): voidAppends s as a JSON string: quoted, with ", \, control characters and lone surrogates escaped.
Re-exported from velt/encoding/json/append
function appendJsonUint(out: StringBuilder, n: u64): voidAppends the decimal digits of an unsigned integer (every u64, unlike an f64).
Re-exported from velt/encoding/json/append
function appendJsonValue(out: StringBuilder, v: JsonValue): voidAppends the JSON text of v (what v.stringify() returns), without making a string of it.
Re-exported from velt/encoding/json/generated
function writeJson<T>(w: StringBuilder, value: T): voidAppends what JSON.stringify(value) writes to w (one function per type, generated).
Re-exported from velt/encoding/json/value
type Value = JsonValueA JSON value of unknown shape: the prelude's JsonValue (docs/std/encoding/json.md).