An open API service indexing awesome lists of open source software.

https://github.com/clarketm/deepclone

Light-weight deep clone implementation for JavaScript.
https://github.com/clarketm/deepclone

clone deep-clone javascript

Last synced: about 1 year ago
JSON representation

Light-weight deep clone implementation for JavaScript.

Awesome Lists containing this project

README

          

# [DeepClone](https://www.travismclarke.com/deepclone/global.html#DeepClone)

Light-weight deep clone implementation for JavaScript.

[![NPM release](https://img.shields.io/npm/v/@clarketm/deepclone.svg)](https://www.npmjs.com/package/@clarketm/deepclone)
[![Build Status](https://circleci.com/gh/clarketm/DeepClone.svg?style=shield)](https://circleci.com/gh/clarketm/deepclone)

> ℹ️ For a standalone **Object** type with this deep clone implementation, check out the [super](https://github.com/clarketm/super) repository: [super/object](https://github.com/clarketm/super/tree/master/packages/Object#readme)

## Installation
```bash
$ npm install @clarketm/deepclone
```

## Modules


DeepClone


## Functions



DeepClone(obj, [config])object


## Typedefs



Config : object


## DeepClone

### DeepClone(obj, [config]) ⇒ object
**Kind**: global method of [DeepClone](#module_DeepClone)
**Returns**: object - cloned object

| Param | Type | Default |
| --- | --- | --- |
| obj | object | |
| [config] | [Config](#Config) | {} |

**Example**
```js
const clone = DeepClone({ key1: ["1", 1, true, (a, b) => a+b], [Symbol("key2")]: {s: "s"} });

console.log(clone);
// { key1: ["1", 1, true, (a, b) => a+b], Symbol("key2"): {s: "s"} }
```

## Config : object
**Kind**: global typedef
**Properties**

| Name | Type | Default |
| --- | --- | --- |
| [includeNonEnumerable] | boolean | false |