Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 11, 2024 via pnpm

deepmerge 4.3.1

A library for deep (recursive) merging of Javascript objects
Package summary
Share
0
issues
1
license
1
MIT
Package created
31 Jan 2012
Version published
16 Mar 2023
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
deepmerge@4.3.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of deepmerge 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does deepmerge do?

Deepmerge is a powerful JavaScript library used for deep, recursive merging of JavaScript objects. It merges the enumerable properties of two or more objects deeply, returning a new object which incorporates the elements from both parent objects. If an element at the same key is present for both parent objects, the value from the second object will appear in the result. By default, arrays are merged by concatenation. Note that the merging creates a new object, ensuring that neither of the original objects is modified.

How do you use deepmerge?

To start using Deepmerge, you'll first need to install it using npm, a popular package manager for the JavaScript programming language. You can install Deepmerge by running the following command in a terminal:

npm install deepmerge

After the installation, you can include Deepmerge in your JavaScript project using the require function, as shown:

const merge = require('deepmerge')

With Deepmerge included in your project, you can start merging objects. Below is an example of how to use Deepmerge to merge two JavaScript objects:

const x = {
    foo: { bar: 3 },
    array: [{ does: 'work', too: [ 1, 2, 3 ] }]
}

const y = {
    foo: { baz: 4 },
    quux: 5,
    array: [{ does: 'work', too: [ 4, 5, 6 ] }, { really: 'yes' }]
}

const output = merge(x, y);

The 'output' object will now be a deep merge of the 'x' and 'y' objects.

The Deepmerge library also provides additional options for merging, including custom merging of arrays or overriding the default merge behavior for specific properties.

Where are the deepmerge docs?

The documentation for the Deepmerge library can be found directly on its GitHub page, at git://github.com/TehShrike/deepmerge.git. Here, you'll find a detailed description of the Deepmerge API, including usage examples and information about different configuration options. The examples shown illustrate how to perform a deep merge, how to merge multiple objects, and how to use various options to customize the behavior of the merge operation. The documentation is clear and concise, making it easy to understand how to use Deepmerge effectively in your JavaScript applications.