Skip to content

Deep clones all fields of the original objects even functions.

License

Notifications You must be signed in to change notification settings

techuila/deep-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deep-clone NPM version NPM monthly downloads NPM total downloads

Deep clones all fields of the original objects even functions.

Installation

Install with npm:

 $ npm install --save @techuila/deep-clone

Usage

Using import:

import deepClone from '@techuila/deep-clone';

Using require:

const deepClone = require('@techuila/deep-clone');
const obj = {
	name: 'john',
	obj: {
		name: 'doe',
		age: 1,
		isMarried: true,
		children: [{ name: 'child 1' }, { name: 'child 2' }, { name: 'child 3' }],
	},
	new: {
		name: 'hello',
		children: [{ name: 'child 1' }, { name: 'child 2' }, { name: 'child 3' }],
	},
};

const copy_object = deepClone(obj);

Author

Axl Cuyugan

License

Released under the ISC License.


About

Deep clones all fields of the original objects even functions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published