Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/ndhoule/clone

Deeply clone an object.
https://github.com/ndhoule/clone

Last synced: 13 days ago
JSON representation

Deeply clone an object.

Awesome Lists containing this project

README

        

# clone [![CI][ci-badge]][ci-link]

Deeply clones a source object.

## Installation

```sh
$ npm install @ndhoule/clone
```

## API

### `clone(target : *)` => *

Deeply copies an input object.

```javascript
var a = { a: 1 };
var cloned = clone(a);

console.log(cloned); //=> { a: 1 }
console.log(cloned === a); //=> false
```

## Acknowledgements

Based on [component/clone](https://github.com/component/clone).

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/clone
[ci-badge]: https://travis-ci.org/ndhoule/clone.svg?branch=master