Skip to main content

Module jsonfmt

Module jsonfmt 

Source
Expand description

JSON that keeps the key order JavaScript would keep.

A trace is compared byte for byte across JavaScript, Python and Rust, and a JavaScript object serializes its keys in insertion order (array-index keys first, ascending). serde_json::Value sorts keys unless the crate-wide preserve_order feature is on, and switching that on would change every other serde_json user in the dependency tree. This module is the small ordered value the recorder writes instead, with JSON.stringify output.

Structs§

JsonObject
An object whose keys iterate the way a JavaScript object’s do.

Enums§

Json
A JSON value whose objects keep JavaScript’s key order.

Functions§

js_number
Number.prototype.toString() for a double.
js_strict_equal
left !== right negated, for values that may be missing (undefined). Objects and arrays read from JSON are never the same reference.
js_string
JavaScript’s String(value) for a value that may be missing (undefined).
utf16_len
Length in UTF-16 code units, which is what JavaScript’s length counts.