Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

deepmerge-ts

Latest version: v8.0.2

Overview

Last scanned
21 Aug 2026
Published
21 Aug 2026
npm package Publisher: rebeccastevens
303 Stars
11 Forks
3 Versions
69.4M Downloads
TypeScript Repo language

Scan summary

deepmerge-ts was last scanned on 21 Aug 2026 at version 8.0.2. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 3 versions; the latest 2 were published within 6 days (16–21 Aug 2026).
  • Findings: No rules fired in version 8.0.2.
  • Downloads: 69,442,746 downloads.

Versions

3 versions published
Versions and the rules that fired in each
VersionPublishedStatus
8.0.2 LATEST 21 Aug 2026 No rules fired
8.0.1 16 Aug 2026 No rules fired
7.1.6 11 Aug 2026 Not shown

No rules fired in 8.0.2

Findings

Findings for v8.0.2. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 8.0.2; other versions have their own rules, not their own score.

Known vulnerabilities

2 CVEs · last 20 Aug 2026

1 CRITICAL 1 HIGH 0 MEDIUM 0 LOW

Versions

  • ≥ 8.0.0
  • ≥ 4.0.2, < 8.0.0 1 HIGH
  • < 4.0.2 1 CRITICAL 1 HIGH

Vulnerabilities

  • CVE-2026-40345 High 20 Aug 2026 DeepmergeTS has stack exhaustion when merging recursive object graphs Fixed in 8.0.0
  • CVE-2022-24802 Critical 1 Apr 2022 Prototype Pollution in deepmerge-ts Fixed in 4.0.2

README

The publisher’s own README, as collected from the registry.

DeepmergeTS

npm version jsr Version CI \ code style: prettier GitHub Discussions BSD 3 Clause license Commitizen friendly semantic-release

Deeply merge 2 or more objects respecting type information.

Donate

Any donations would be much appreciated. 😄

Enterprise Users

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.

Installation

npm
# Install with npm
npm install deepmerge-ts

# Install with pnpm
pnpm add deepmerge-ts

# Install with yarn
yarn add deepmerge-ts

# Install with bun
bun add deepmerge-ts
jsr
# Install in a node project
npx jsr add @rebeccastevens/deepmerge

# Install in a deno project
deno add jsr:@rebeccastevens/deepmerge

# Install in a bun project
bunx jsr add @rebeccastevens/deepmerge

Features

  • Smart merging - High performance.
  • Merged output has correct typing.
  • Record merging support.
  • Array merging support.
  • Map and Set merging support.
  • Circular reference support.
  • Security safeguards.
  • Recursion depth limit (defaults to 1000) to prevent stack exhaustion.
  • High-performance deepmergeFastUnsafe variants for trusted data.
  • Customized merging.

Usage

Example using default config
import { deepmerge } from "deepmerge-ts";

const x = {
  record: {
    prop1: "value1",
    prop2: "value2",
  },
  array: [1, 2, 3],
  set: new Set([1, 2, 3]),
  map: new Map([
    ["key1", "value1"],
    ["key2", "value2"],
  ]),
};

const y = {
  record: {
    prop1: "changed",
    prop3: "value3",
  },
  array: [2, 3, 4],
  set: new Set([2, 3, 4]),
  map: new Map([
    ["key2", "changed"],
    ["key3", "value3"],
  ]),
};

const z = {
  record: {
    prop1: undefined,
    prop3: undefined,
    prop2: undefined,
    prop4: undefined,
  },
  array: undefined,
  set: undefined,
  map: undefined,
};

const merged = deepmerge(x, y, z);

console.log(merged);

// Prettierfied output:
//
// Object {
//   "record": Object {
//     "prop1": "changed",
//     "prop2": "value2",
//     "prop3": "value3",
//     "prop4": undefined,
//   },
//   "array": Array [1, 2, 3, 2, 3, 4],
//   "set": Set { 1, 2, 3, 4 },
//   "map": Map {
//     "key1" => "value1",
//     "key2" => "changed",
//     "key3" => "value3",
//   },
// }

You can try out this example at codesandbox.io.

Merging into a Target

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).

Customizing the Merging Process

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.

TypeScript Interfaces

Due to how TypeScript handles interfaces (microsoft/TypeScript#15300), interface types without an explicit index signature may not appear to merge correctly. For proper type inference when merging objects, use type aliases instead of interfaces.

High-Performance "FastUnsafe" Variants

For performance-critical code where inputs are trusted and non-circular, we provide high-performance variants that skip circular reference tracking, depth limits, prototype pollution safeguards, and metadata allocations:

  • deepmergeFastUnsafe & deepmergeFastUnsafeCustom
  • deepmergeIntoFastUnsafe & deepmergeIntoFastUnsafeCustom

[!WARNING] Only use these functions with trusted, non-circular data. Using with untrusted user data can result in security vulnerabilities such as prototype pollution and Denial of Service (DoS) from unbounded recursion / stack overflow.

See API docs for more details.

Performance

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.

Classic Merge (not what we do)

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.

Smart Merge (what we do)

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.

API

See API docs.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm deepmerge-ts

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Frame 2085668439 (1)
Group 1261154229