Repository navigation
v5.0.0 — JSON Atom
JSON Atom is now available in the stable v5 release of json-diff-ts.
npm install json-diff-ts@5Features and fixes
- JSON Atom diff, apply, invert and revert APIs, move/copy operations, and workflow helpers.
keysToIncludefor selecting fields and subtrees, withkeysToSkipprecedence (#403).- Correct special-property and identity path round-trips, including dotted and bracketed names (#415).
- Correct array removal/revert ordering (#404, #412), null transitions, nested arrays, and typed identity filters.
- Strict JSON Atom target and payload validation; failed moves preserve their source, and applying changes preserves stored operation payloads.
- ESM, CommonJS, and TypeScript declarations with conditional package exports.
Migration notes
Legacy changeset APIs remain available. JSON Atom values must be JSON-safe; invalid operations now throw instead of silently doing nothing. Duplicate or string-colliding producer identities are rejected. Identity-based array diffing ignores order; use index-based diffing when exact order matters. Legacy conversion cannot recover numeric/boolean identity types from string-quoted paths; recompute with diffAtom() when needed. See the README migration section for full details.
Validation
903 tests and 13 snapshots pass, including 400 exhaustive JSON value-pair round-trips. An additional deterministic randomized check covered 1,000 JSON pairs. CI passed on Node 20, 22 and 24; CodeQL, Snyk and SonarCloud quality checks passed. The packed archive was installed in an isolated consumer and verified with ESM/CommonJS execution and TypeScript NodeNext resolution.
Compatible development dependency updates remove the audited high/critical findings. Lower-severity development-tool audit findings remain; there are no runtime dependencies.
Implemented in #416. Thanks to Aaron Döppner for the array-revert contribution from #412.
Published to npm latest through GitHub OIDC trusted publishing with provenance (#417).