# leapond-deepcopy

> Object, Array, Set, Map supported deepcopy.

Latest version **1.0.7** (published 2021-07-28) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install leapond-deepcopy
pnpm add leapond-deepcopy
yarn add leapond-deepcopy
bun add leapond-deepcopy
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2021-07-28 |
| First published | 2021-07-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 12 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Leapond, Inc. |
| Maintainers | leapond |
| Keywords | deepcopy, deep, copy, Object, Array, Set, Map, depth, limitation, max, depth, leapond |

## Links

- npm: https://www.npmjs.com/package/leapond-deepcopy
- Repository: https://github.com/leapond/js-deepcopy
- Homepage: https://github.com/leapond/js-deepcopy#readme
- Issues: https://github.com/leapond/js-deepcopy/issues
- npm.io page: https://npm.io/package/leapond-deepcopy

## Dependencies (1)

- [leapond-js-utils](https://npm.io/package/leapond-js-utils.md) ^1.0.6

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2021-07-28
- 1.0.6 — 2021-07-28
- 1.0.5 — 2021-07-27
- 1.0.4 — 2021-07-27
- 1.0.3 — 2021-07-27
- 1.0.2 — 2021-07-26
- 1.0.1 — 2021-07-23
- 1.0.0 — 2021-07-23

## README

# js-deepcopy

Object, Array, Set, Map supported deepcopy.

## Installation

**NPM**

```shell
npm i leapond-deepcopy
```

**Yarn**

```shell
yarn add leapond-deepcopy
```

## Usage

```javascript
// bundled
import deepCopy from "leapond-deepcopy";
// source (recommend)
import deepCopy from "leapond-deepcopy/src";

let target = {
  a: [1, 2, 3],
  o: {x: 1, y: 2, z: {zz: 3}},
  s: new Set([1, 2]),
  m: new Map([[1, 100]])
}, result

console.log(
    result = deepCopy(target, 2/* depthMax */),
    result === target,        // false
    result.a,
    result.a === target.a,    // false
    result.o,
    result.o === target.o,    // false
    result.s,
    result.s === target.s,    // false
    result.m,
    result.m === target.m,    // false
    result.o.z,
    result.o.z === target.o.z // true
)
```

---
_Source: https://npm.io/package/leapond-deepcopy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
