Secure merge. Familiar contract.
@stackline/deepmerge
Immutable deep merge with prototype-pollution defenses, cycles, resource limits, accurate types, and zero runtime dependencies.
npm install @stackline/deepmerge
v1.0.0 Node 14.17+ TypeScript 3.9-7.0
Runs the production bundle
Merge playground
Target
JSONSource
JSONResult
Lowest-change adoption
Keep existing imports
Install through an npm alias and code that imports
deepmerge continues to work.
npm uninstall deepmerge
npm install deepmerge@npm:@stackline/deepmerge
import merge from 'deepmerge';
const config = merge(defaults, environment);
Public contract
One small API surface
| Export | Purpose | Available in |
|---|---|---|
merge(target, source, options?) | Immutable recursive merge | ESM, CJS, browser |
merge.all(objects, options?) | Merge a list from left to right | ESM, CJS, browser |
isMergeableObject(value) | Default traversal predicate | Named and static export |
UnsafeKeyError | Strict unsafe-key rejection | Named and static export |
DeepMergeLimitError | Depth or key budget exceeded | Named and static export |
Release evidence
Compatibility is tested, not implied
- 5,000
- deterministic differential cases against deepmerge 4.3.1
- 100%
- statement, line, and function coverage at release
- 3.9-7.0
- TypeScript compatibility matrix
- 0
- runtime dependencies