Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Apr 16, 2024 via pnpm

lodash.clonedeep 4.5.0

The lodash method `_.cloneDeep` exported as a module.
Package summary
Share
0
issues
1
license
1
MIT
Package created
23 Sep 2013
Version published
13 Aug 2016
Maintainers
2
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:
lodash.clonedeep@4.5.0
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 lodash.clonedeep 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does lodash.clonedeep do?

The "lodash.clonedeep" is a handy npm package that provides functionality of the "_.cloneDeep" method from lodash library. It allows you to create deep copies of JavaScript objects. These copies won't be tied to the original objects, meaning changes to copies won't affect the original ones and vice versa. It's especially relevant in contexts where immutability is crucial, for example, while working with Redux in React or while manipulating complex nested objects where a shallow copy would not be enough.

How do you use lodash.clonedeep?

To use the "lodash.clonedeep" function in your JavaScript project, you first need to install it through npm. Run the following command in your terminal:

$ npm i --save lodash.clonedeep

Once installed, you can then require the package in your JavaScript file like this:

var cloneDeep = require('lodash.clonedeep');

Afterwards, you can use the "cloneDeep" function to create deep copies of your objects:

var object = { a: 1, b: 2 };
var deepCopy = cloneDeep(object);

console.log(object === deepCopy); // Output: false

deepCopy.a = 5;
console.log(object.a); // Output: 1
console.log(deepCopy.a); // Output: 5

The example above shows that a change to the copy (deepCopy.a) does not affect the original object (object.a).

Where are the lodash.clonedeep docs?

The comprehensive documentation including the details about the usage of "lodash.clonedeep" module can be found on the lodash's official website. The specific section for "cloneDeep" method is available at this URL: https://lodash.com/docs#cloneDeep. Besides, you can also explore the package source for more details on GitHub via this link: https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.clonedeep.