1.1.0 • Published 1 year ago
better-structured-clone v1.1.0
better-structured-clone
A node module to deep-clone objects (or anything) that works better. Common packages like structuredClone or the deep-clone functionality in lowdash has massive drawbacks by not supporting symbols and functions. This package solves this.
Installation
npm install better-structured-clone
Usage
const clone = require('better-structured-clone');
const object = {
symbol: Symbol('symbol'),
function: () => console.log('function'),
string: 'string',
number: 1,
}
const clonedObject = clone(object);