Skip to main content

Module json

Module json 

Source
Expand description

JSON with JS semantics: JSON.parse, JSON.stringify, JS property order, and JS number formatting and parsing.

Modules§

number
JS number semantics the client has to reproduce exactly: Number.prototype.toString (also what JSON.stringify writes) and Number(string).

Structs§

Object
A JSON object: string keys to Values, with keys kept the way a JS object keeps its properties.
ParseError
Why parse rejected its input.
SerdeError
Why a value couldn’t be written or read.

Enums§

Value
A JSON value, the data model Zero syncs and stores.

Constants§

MAX_DEPTH
Nesting deeper than this is rejected with TOO_DEEP.
TOO_DEEP
The message of the error for JSON nested deeper than MAX_DEPTH.

Functions§

from_value
value read as a T.
parse
Parses JSON text as JSON.parse does.
stringify
Encodes a value as JSON.stringify does: the same string escaping and number formatting, with non-finite numbers written as null.
to_value
value as a JSON value.
write
Appends value as JSON text.
write_string
Appends s as a JSON string literal.