Gathering detailed insights and metrics for deepmerge-ts
Gathering detailed insights and metrics for deepmerge-ts
Gathering detailed insights and metrics for deepmerge-ts
Gathering detailed insights and metrics for deepmerge-ts
ts-deepmerge
A TypeScript deep merge function.
merge-deep-ts
Deep fast merge JavaScript objects with circular references handling and TypeScript support
@trkm/http-session-deepmerge-ts
Stores a page's context in a session: merging existing session context as needed.
magnamvelit
Deeply merge 2 or more objects respecting type information.
Deeply merge 2 or more objects respecting type information.
npm install deepmerge-ts
Typescript
Module System
Min. Node Version
Node Version
NPM Version
98.8
Supply Chain
100
Quality
80.5
Maintenance
100
Vulnerability
100
License
TypeScript (100%)
Total Downloads
101,333,007
Last Day
81,417
Last Week
1,365,532
Last Month
5,876,201
Last Year
57,590,418
BSD-3-Clause License
270 Stars
827 Commits
10 Forks
1 Watchers
1 Branches
6 Contributors
Updated on Jul 06, 2025
Minified
Minified + Gzipped
Latest Version
7.1.5
Package Id
deepmerge-ts@7.1.5
Unpacked Size
132.65 kB
Size
25.84 kB
File Count
8
NPM Version
10.7.0
Node Version
20.18.2
Published on
Feb 23, 2025
Cumulative downloads
Total Downloads
Last Day
2.9%
81,417
Compared to previous day
Last Week
-7.6%
1,365,532
Compared to previous week
Last Month
3.2%
5,876,201
Compared to previous month
Last Year
93.3%
57,590,418
Compared to previous year
64
Any donations would be much appreciated. 😄
deepmerge-ts
is available as part of the Tidelift Subscription.
Tidelift is working with the maintainers of deepmerge-ts
and a growing network of open source maintainers to ensure
your open source software supply chain meets enterprise standards now and into the future.
Learn more.
1# Install with npm 2npm install deepmerge-ts 3 4# Install with pnpm 5pnpm add deepmerge-ts 6 7# Install with yarn 8yarn add deepmerge-ts 9 10# Install with bun 11bun add deepmerge-ts
1# Install in a node project 2npx jsr add @rebeccastevens/deepmerge 3 4# Install in a deno project 5deno add jsr:@rebeccastevens/deepmerge 6 7# Install in a bun project 8bunx jsr add @rebeccastevens/deepmerge
1import { deepmerge } from "deepmerge-ts"; 2 3const x = { 4 record: { 5 prop1: "value1", 6 prop2: "value2", 7 }, 8 array: [1, 2, 3], 9 set: new Set([1, 2, 3]), 10 map: new Map([ 11 ["key1", "value1"], 12 ["key2", "value2"], 13 ]), 14}; 15 16const y = { 17 record: { 18 prop1: "changed", 19 prop3: "value3", 20 }, 21 array: [2, 3, 4], 22 set: new Set([2, 3, 4]), 23 map: new Map([ 24 ["key2", "changed"], 25 ["key3", "value3"], 26 ]), 27}; 28 29const z = { 30 record: { 31 prop1: undefined, 32 prop3: undefined, 33 prop2: undefined, 34 prop4: undefined, 35 }, 36 array: undefined, 37 set: undefined, 38 map: undefined, 39}; 40 41const merged = deepmerge(x, y, z); 42 43console.log(merged); 44 45// Prettierfied output: 46// 47// Object { 48// "record": Object { 49// "prop1": "changed", 50// "prop2": "value2", 51// "prop3": "value3", 52// "prop4": undefined, 53// }, 54// "array": Array [1, 2, 3, 2, 3, 4], 55// "set": Set { 1, 2, 3, 4 }, 56// "map": Map { 57// "key1" => "value1", 58// "key2" => "changed", 59// "key3" => "value3", 60// }, 61// }
You can try out this example at codesandbox.io.
You can use deepmergeInto
if you want to update a target object with the merge result instead of creating a new
object.
This function is best used with objects that are all of the same type.
Note: If the target object's type differs from the input objects, we'll assert that the target's type has changed
(this is not done automatically with deepmergeIntoCustom
).
We provide a customizer function for each of our main deepmerge functions: deepmergeCustom
and deepmergeIntoCustom
.
You can use these to customize the details of how values should be merged together.
See deepmerge custom docs for more details.
We use smart merging instead of the classic merging strategy which some alternative libraries use. This vastly improves performance, both in execution time and memory usage.
With classic merging, each input is merged with the next input until all inputs are merged.
This strategy has large performance issues when lots of items need to be merged.
With our smart merging, we look ahead to see what can be merged and only merge those things.
In addition to performance improvements, this strategy merges multiple inputs at once; allowing for benefits such as taking averages of the inputs.
See API docs.
8.1/10
Summary
Prototype Pollution in deepmerge-ts
Affected Versions
< 4.0.2
Patched Versions
4.0.2
Reason
27 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
12 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More