Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lodash.clonedeep

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.clonedeep

The lodash method `_.cloneDeep` exported as a module.

  • 4.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12M
increased by0.26%
Maintainers
3
Weekly downloads
 
Created

What is lodash.clonedeep?

The lodash.clonedeep package is a module of the Lodash library that provides a deep cloning function. This function creates a deep copy of a value, meaning that it recursively clones every level of nested objects or arrays, ensuring that no references to the original objects are kept in the clone. This is particularly useful when you need to manipulate data without altering the original source.

What are lodash.clonedeep's main functionalities?

Deep cloning objects

This feature allows you to create a deep copy of an object, including all nested objects, without any shared references.

{"const _ = require('lodash.clonedeep');
const object = { a: 1, b: { c: 2 } };
const clonedObject = _.cloneDeep(object);
console.log(clonedObject); // { a: 1, b: { c: 2 } }
console.log(object === clonedObject); // false
console.log(object.b === clonedObject.b); // false"}

Deep cloning arrays

This feature allows you to create a deep copy of an array, including all nested arrays, without any shared references.

{"const _ = require('lodash.clonedeep');
const array = [1, [2, [3, [4]]]];
const clonedArray = _.cloneDeep(array);
console.log(clonedArray); // [1, [2, [3, [4]]]]
console.log(array === clonedArray); // false
console.log(array[1] === clonedArray[1]); // false"}

Other packages similar to lodash.clonedeep

Keywords

FAQs

Package last updated on 13 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc