All Projects → jonschlinkert → Clone Deep

jonschlinkert / Clone Deep

Licence: mit
Recursively (deep) clone JavaScript native types, like Object, Array, RegExp, Date as well as primitives. Used by superstruct, merge-deep, and many others!

Programming Languages

javascript
184084 projects - #8 most used programming language
js
455 projects

Projects that are alternatives of or similar to Clone Deep

copy-anything
An optimised way to copy'ing (cloning) an Object or Array. A small and simple integration
Stars: ✭ 19 (-91.7%)
Mutual labels:  clone, copy, object
js-deep-sort-object
Simple module to sort objects recursively by its keys
Stars: ✭ 19 (-91.7%)
Mutual labels:  object, deep
cloner
A deep copy algorithm for haxe
Stars: ✭ 24 (-89.52%)
Mutual labels:  clone, copy
Differentia.js
No longer being supported or maintained. A Graph Theory & Data Structure Library for JavaScript.
Stars: ✭ 13 (-94.32%)
Mutual labels:  clone, deep
Clone
A professional deep clone library
Stars: ✭ 201 (-12.23%)
Mutual labels:  clone, deep
CarND-VehicleDetection
vehicle detection with deep learning
Stars: ✭ 34 (-85.15%)
Mutual labels:  object, deep
Discord Guild Copy
A script to copy a discord guild/server
Stars: ✭ 127 (-44.54%)
Mutual labels:  clone, copy
Deep Object Diff
Deep diffs two objects, including nested structures of arrays and objects, and returns the difference. ❄️
Stars: ✭ 515 (+124.89%)
Mutual labels:  object, deep
underscore.haz
🔍 _.haz() is like _.has() but this underscore and/or lodash mixin lets you do deep object key existence checking with a dot denoted string, for example 'a.b.c'
Stars: ✭ 13 (-94.32%)
Mutual labels:  object, deep
get
🚚 A really small and type-safe (requires TypeScript >= 4.1.3) function, that gets a nested value from an object using a path string (like "a.b[0].d"). If value is 'undefined' or unreachable returns the placeholder instead.
Stars: ✭ 13 (-94.32%)
Mutual labels:  object, deep
Shallow Clone
Make a shallow clone of an object, array or primitive.
Stars: ✭ 23 (-89.96%)
Mutual labels:  clone, object
Get Value
Use property paths (`a.b.c`) get a nested value from an object.
Stars: ✭ 194 (-15.28%)
Mutual labels:  object, deep
Weresync
Clones Linux hard drives incrementally or to a smaller drive
Stars: ✭ 180 (-21.4%)
Mutual labels:  clone
Gitlabber
Gitlabber - clones or pulls entire groups tree from gitlab
Stars: ✭ 176 (-23.14%)
Mutual labels:  clone
Pydesignpattern
Design Pattern that described by Python, This is the source code for the book of Everybody Know Design Patterns.
Stars: ✭ 174 (-24.02%)
Mutual labels:  clone
Yolo person detect
person detect based on yolov3 with several Python scripts
Stars: ✭ 212 (-7.42%)
Mutual labels:  object
Tinderclone
Tinder App Clone
Stars: ✭ 196 (-14.41%)
Mutual labels:  clone
Deepdash
eachDeep, filterDeep, findDeep, someDeep, omitDeep, pickDeep, keysDeep etc.. Tree traversal library written in Underscore/Lodash fashion
Stars: ✭ 175 (-23.58%)
Mutual labels:  object
Discord Backup
📦 Complete framework to facilitate server backup using discord.js v12
Stars: ✭ 172 (-24.89%)
Mutual labels:  clone
Mrboom Libretro
Mr.Boom is an 8 player Bomberman clone for RetroArch/Libretro
Stars: ✭ 162 (-29.26%)
Mutual labels:  clone

clone-deep NPM version NPM monthly downloads NPM total downloads Linux Build Status

Recursively (deep) clone JavaScript native types, like Object, Array, RegExp, Date as well as primitives.

Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your ❤️ and support.

Install

Install with npm:

$ npm install --save clone-deep

Usage

const cloneDeep = require('clone-deep');

let obj = { a: 'b' };
let arr = [obj];
let copy = cloneDeep(arr);
obj.c = 'd';

console.log(copy);
//=> [{ a: 'b' }]

console.log(arr);
//=> [{ a: 'b', c: 'd' }]

Heads up!

The last argument specifies whether or not to clone instances (objects that are from a custom class or are not created by the Object constructor. This value may be true or the function use for cloning instances.

When an instanceClone function is provided, it will be invoked to clone objects that are not "plain" objects (as defined by isPlainObjectisPlainObject). If instanceClone is not specified, this library will not attempt to clone non-plain objects, and will simply copy the object reference.

Attribution

Initially based on mout's implementation of deepClone.

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Running Tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test
Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Related projects

You might also be interested in these projects:

Contributors

Commits Contributor
46 jonschlinkert
2 yujunlong2000

Author

Jon Schlinkert

License

Copyright © 2018, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.8.0, on November 21, 2018.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].