@febin52/deep-clone-fast
v1.0.2
Published
Benchmark-beating structured clone alternative supporting Maps, Sets, Dates, and TypedArrays.
Maintainers
Readme
🧬 @febin52/deep-clone-fast
Benchmark-beating structured deep clone alternative supporting Objects, Arrays, Maps, Sets, Dates, and RegExps.
A high-performance deep cloning algorithm engineered to safely copy complex nested JavaScript objects and data structures without prototype pollution or circular reference traps.
🚀 Features
- ⚡ Blazing Fast: Faster than native
structuredClonefor standard object payloads. - 🔄 Circular Reference Protection: Uses internal WeakMap reference tracking.
- 📦 Supports Native Types: Objects, Arrays, Maps, Sets, Dates, and RegExps.
📦 Installation
npm install @febin52/deep-clone-fast💡 Usage
import { deepClone } from '@febin52/deep-clone-fast';
const original = {
name: 'Antigravity',
createdAt: new Date(),
tags: new Set(['fast', 'typescript']),
meta: new Map([['version', '1.0.0']])
};
const clone = deepClone(original);
console.log(clone !== original); // true
console.log(clone.tags !== original.tags); // true🔗 Links
- NPM Package: https://www.npmjs.com/package/@febin52/deep-clone-fast
- GitHub Repository: https://github.com/febin52/deep-clone-fast
- Issue Tracker: https://github.com/febin52/deep-clone-fast/issues
📄 License
MIT © Febin Francis
