Shallow Clone Utility

JSON →
library 3.0.1 ·javascript
verified May 27, 2026

shallow-clone is a JavaScript utility library designed for creating shallow copies of various data types. It supports a comprehensive range of values including primitives, plain objects, arrays, regular expressions, dates, buffers, array buffers, all JavaScript typed arrays (e.g., Int8Array, Uint8Array), Maps, and Sets. Currently at version 3.0.1, the package focuses exclusively on performing a shallow clone, which means only the top-level structure of the input value is copied. Any nested objects or arrays within the cloned structure will retain their original references. This characteristic is a key differentiator, distinguishing it from 'deep cloning' libraries like `clone-deep`, which recursively copy all nested structures. The library is considered stable and suitable for scenarios where a new top-level instance is required without altering the original, and shared references for nested data are acceptable.

total hits 40
actors 8 distinct systems
last hit 3d ago human
GPTBot
5
Amazonbot
4
MetaBot
4
Script
1
ClaudeBot
1
Search engines
1
Humans
3

top countries 🇨🇦 Canada · 🇺🇸 United States · VN · 🇩🇪 Germany · 🇳🇱 Netherlands