v4.0.0-beta.2
Pre-release
Pre-release
4.0.0-beta.2 (2026-05-13)
Bug Fixes
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) === twith the return value. - Replace any post-call inspection of t with the return value.
- Pass
mutate = trueas the third argument to restore in-place merging.
- Replace any reliance on