Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/gyumeijie/jsoc

Clone or Copy a JavaScript Object
https://github.com/gyumeijie/jsoc

npm-package obj-copy object-clone object-copy utility

Last synced: about 19 hours ago
JSON representation

Clone or Copy a JavaScript Object

Awesome Lists containing this project

README

        

# jsoc [![](https://travis-ci.com/Gyumeijie/jsoc.svg?branch=master)](https://travis-ci.com/Gyumeijie/jsoc)

> Clone or Copy a JavaScript Object.

## Install

```bash
$ npm install @gyumeijie/jsoc
```

## Usage

```js
const clone = require('@gyumeijie/jsoc');

let a = { foo: { bar: 'baz' } };

let b = clone(a);
a.foo.bar = 'foo';

console.log(a); // { foo: { bar: 'foo' } }
console.log(b); // { foo: { bar: 'baz' } }
```

## License

MIT © [Gyumeijie](https://github.com/Gyumeijie)