JSON encoding for the machine formats (design notes §5.2).
Documents are built from Jason.OrderedObjects so keys keep the documented order.
Strings that reach a document (diffs, source excerpts, test names, reasons) may hold
bytes that are not UTF-8; Jason refuses those (deps:jason), so every binary is
scrubbed first, each invalid sequence replaced with U+FFFD.
Summary
Functions
Encodes term compactly after scrub/1. Never pretty: NDJSON lines are one line.
@spec object([{String.t(), term()}]) :: Jason.OrderedObject.t()
An ordered JSON object from {key, value} pairs.
Replaces invalid UTF-8 in every binary of term (keys too) with U+FFFD.