ELSEIF
Your brief EB
320 stories from 72 feeds 58 clusters Refreshed 13 minutes ago next pull 01:35

AI Signal 229

condense-json 1.1

Illustration only Photo by Olivier Giboulot on Unsplash

condense-json 1.1 extends the replacement mechanism to accept non-string values and adds object-based merge detection, accompanied by property-based round-trip tests.

WHY IT MATTERS

Engineers can now pass numbers, booleans, or other objects as replacement tokens, enabling structural changes beyond simple text substitution. The merge detection lets the library record update or delete instructions for similar objects, which uncondense_json() can later apply, reducing manual post-processing of condensed JSON.

Written by elseif from the cluster below · every claim links back to a source

The three things worth knowing

01

Replacement objects may now contain values of any type, which condense_json() and uncondense_json() treat as structural replacements.

02

When an object is supplied as a replacement, condense_json() looks for close matches in the input and stores update or delete instructions that uncondense_json() can execute.

03

The release includes round-trip tests built with the Hypothesis library to verify that condensing and then uncondensing preserves the original data.

THE READ

What elseif makes of it.

ORIGINAL ANALYSIS

The library’s core condense_json() function now accepts replacement objects that contain non-string values, expanding the set of tokens that can trigger structural changes. Previously only string replacements were recognized, limiting use cases to literal text substitution. Objects supplied as replacements are examined for similarity with parts of the JSON input. When a close match is found, condense_json() records the necessary key updates or deletions.

Existing code that passes only string replacements continues to work unchanged because the new behavior is additive. To leverage the new features, developers must replace string tokens with objects that encode the desired structural intent. Adopting the merge capability requires understanding what the library considers a 'close match' between objects. No additional dependencies are required beyond the existing package, though the round-trip tests rely on Hypothesis for validation.

If the supplied replacement object does not have a sufficiently similar counterpart in the input, condense_json() will not generate any merge instructions. In such cases uncondense_json() will have nothing to apply, and the output will reflect only the string-based replacements that were recognized. The library does not attempt to merge objects that are structurally dissimilar, so users must ensure their replacement objects resemble the target data. These limits mean the feature is ineffective for arbitrary object replacements that lack a close match.

Written by elseif from the cluster below · checked for specifics the sources never contained

THE CLUSTER

Same story, 1 feed.

ORDERED BY FIRST SEEN
Simon Willison condense-json 1.1 Open ↗