Skip to main content

Module json

Module json 

Source
Expand description

JSON / JSONL minifiers (v0.2). Comment-free formats: the MinifyOptions::keep_comments flag is a no-op here.

Functions§

minify_json
Parse source as a single JSON document and re-serialize compactly. Whitespace, newlines, and indentation are dropped; field order is preserved (via serde_json’s preserve_order feature).
minify_jsonl
Parse source as JSONL — one JSON document per line. Empty and whitespace-only lines are dropped from the output. If any line fails to parse, the whole minification fails (caller emits the original block verbatim).