Skip to content

v4.0.1

Choose a tag to compare

@beningreenjam beningreenjam released this 20 Jun 12:40
· 16 commits to main since this release

A patch release that fixes a serialised-output bug and removes a performance cliff. It contains one technically breaking output change, included solely to correct buggy output.

⚠️ Breaking output change (bug fix)

Under serialise: true, a cycle through a Map or Set previously leaked the transformer's synthetic value wrapper into the circular-marker path. The path is now logical and consistent with object/array cycle paths and with the marker's own value field:

Shape Before (4.0.0) After (4.0.1)
root Set self-cycle value.0 0
root Map self-cycle value.me me
nested Set self-cycle roles.value.0 roles.0
nested Map self-cycle meta.value.me meta.me

If you parse circular markers inside Map/Set payloads, update accordingly. Unchanged: the deepRedact/createRedactor API and all options, exported types, the runtime input contract, all object-mode (serialise: false) output, every non-Map/Set marker, and the marker value field.

🚀 Performance

serialise: true no longer degrades non-linearly with payload depth. Path tracking is now lazy — materialised only when a circular marker is actually emitted — so deep payloads no longer pay a per-node descent cost. Measured ~4–5% faster than 4.0.0 on the deep serialised benchmark, with no object-mode regression. Output is byte-identical to the corrected contract above.

Compatibility

Drop-in for 4.0.0 unless you parse Map/Set circular-marker paths. Same Node support, same public API.