Skip to main content

Module json

Module json 

Source
Expand description

Strict JSON (SPEC 6.1, I-JSON) and the RFC 8785 JSON Canonicalization Scheme (SPEC 6.2).

parse accepts exactly the texts SPEC 6.1 accepts and reports failures in the order it defines. Value::to_jcs writes the RFC 8785 serialisation, including ECMAScript number formatting, so it is a complete JCS even though Datumesh objects never contain JSON numbers.

Structs§

Number
A JSON number: the text it was written as, and its IEEE 754 double value.

Enums§

Value
A parsed JSON value. Object members keep their text order; names are unique.

Constants§

MAX_DEPTH
The deepest nesting of arrays and objects accepted (SPEC 6.1).

Functions§

canonicalize_json
Parses bytes and returns their JCS serialisation.
check_value_depth
Checks that an already-parsed value nests at most MAX_DEPTH arrays and objects (SPEC 6.1 applies the parser’s limit to values accepted in parsed form). E_PARSE_JSON.
format_number
Formats a finite double as ECMAScript Number.prototype.toString does (RFC 8785 3.2.2.3).
parse
Parses bytes as strict JSON (SPEC 6.1).