Skip to content

v4.0.0-beta.2

Pre-release
Pre-release

Choose a tag to compare

@untemps untemps released this 13 May 11:43

4.0.0-beta.2 (2026-05-13)

Bug Fixes

  • object: Make deepMerge immutable by default, add mutate flag (#60) (0348da8)

BREAKING CHANGES

  • object: deepMerge now returns a new object and no longer mutates its inputs.
    Previously, deepMerge merged source into target in place and returned the same target reference. Both source and target could be silently modified as a side effect.
    The new default behaviour (mutate = false) clones target as the result base via structuredClone — neither source nor target is touched, and the return value is always a distinct object. Source-only object values are also deep-cloned, so the result shares no references with source.
    Migration:
    • Replace any reliance on deepMerge(s, t) === t with the return value.
    • Replace any post-call inspection of t with the return value.
    • Pass mutate = true as the third argument to restore in-place merging.