jsoncopy

Create a deep clone of an object using JSON functionalities.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
jsoncopy
1.0.04 years ago4 years agoMinified + gzip package size for jsoncopy in KB

Readme

jsoncopy
Create a deep clone of an object using JSON functionalities. Very efficient and quick, not a comprehensive copyier (can't copy functions, circular references)
const jsoncopy = require('jsoncopy');

const orig = {top: {nested: {value: 1}}};
const copy = jsoncopy(obj);
orig.top.nested.value = 2;

orig.top.nested.value // 2
copy.top.nested.value // 1