1.1.0 • Published 1 year ago

better-structured-clone v1.1.0

Weekly downloads
-
License
AGPL-3.0-or-later
Repository
github
Last release
1 year ago

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);
1.1.0

1 year ago

1.0.0

1 year ago