High-performance deep clone utility with descriptor support. Handles circular ref and complex built-in types.
npm i bunshin-clone// npm
import { bunshinClone } from 'bunshin-clone';
// CDNs
import { bunshinClone } from 'https://esm.sh/bunshin-clone@<x.x.x>';
// or
import { bunshinClone } from 'https://cdn.jsdelivr.net/npm/bunshin-clone@<x.x.x>/+esm';
// or
import { bunshinClone } from 'https://esm.unpkg.com/bunshin-clone@<x.x.x>';bunshinClone<T>(value, options);
// => T
//
// value: T
// options (optional): BunshinCloneOptionsinterface BunshinCloneOptions {
preserveBufferSharing: boolean; // default: false
preserveDescriptors: boolean; // default: false
preserveSymbolKeys: boolean; // default: false
}If true, preserves shared backing buffers between TypedArray and DataView instances.
If true, preserves property descriptors, including non-enumerable properties.
If true, preserves symbol keys (slower).