Mechanism◆Article
condense_json(input_json, replacements) scans the input JSON for strings or substrings present in the replacements object and replaces them with a special {"$r": ...} syntax in the output.
The author explains the core mechanism: condense_json replaces matching strings or substrings from a replacements object with a special {"$r": ...} syntax, illustrated with a README example. ✦ AI generated
The author · Simon Willison's Weblog · 2026-08-02 · original ↗
It scans for strings or substrings that are present in that replacements object and replaces those with a special {"$r": ...} syntax in the output.
Read full article ↗excerpt · fair-use quotation
- ·Scans input JSON for strings or substrings
- ·Matches against keys in a replacements object
- ·Replaces matches with a special {"$r": ...} syntax
- ·Output is a condensed JSON representation
- ·Replacements object defines what to find and replace
- ·Substring matching — not just exact string matches
- ·Author demonstrates with a README example
- ·Output uses {"$r": ...} as the replacement marker
Around this claim