Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/ndhoule/clone
- Owner: ndhoule
- License: mit
- Created: 2016-05-09T23:09:22.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-05-09T23:24:11.000Z (over 8 years ago)
- Last Synced: 2024-10-11T19:23:09.797Z (about 1 month ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE.md
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