Skip to main content

Module value

Module value 

Source
Expand description

The ParseValue model: every JSON value a client can send or receive in an object body.

Two decisions here are load-bearing, and both look like mistakes until the reason is stated.

ParseMap preserves key order. Several upstream behaviors iterate object keys, and the resulting order is observable in golden-file comparison even where it is not semantically meaningful. A HashMap destroys it on every round trip and makes snapshot testing impossible.

Nothing here derives PartialEq. A derived one would compile, read as correct, and get both float edge cases backwards at the one call site that decides which keys a client is told about. Use deep_strict_eq, which implements Node’s util.isDeepStrictEqual semantics.

Enums§

ParseValue
A Parse value.

Functions§

base64_decode
base64_encode
Standard base64 with padding, matching what BytesCoder accepts (MongoTransform.js:1306). Hand-rolled to keep parse-rust-core dependency-light; it is 20 lines and the alphabet is fixed by the wire format. Base64, as the {"__type":"Bytes","base64":...} envelope spells it.
deep_strict_eq
Deep equality with Node’s util.isDeepStrictEqual semantics.
is_base64_value
The inverse. Rejects any character outside the alphabet rather than skipping it, because a lenient decoder would silently accept a corrupted payload from an untrusted client. Does this string match BytesCoder.base64Pattern?

Type Aliases§

ParseMap
An order-preserving string-keyed map. See the module note.