Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mateusmaso/underscore.deepclone
Underscore helper for deep cloning objects
https://github.com/mateusmaso/underscore.deepclone
clone deepclone underscore
Last synced: 13 days ago
JSON representation
Underscore helper for deep cloning objects
- Host: GitHub
- URL: https://github.com/mateusmaso/underscore.deepclone
- Owner: mateusmaso
- License: mit
- Created: 2013-09-19T20:28:17.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-07-20T14:32:43.000Z (over 7 years ago)
- Last Synced: 2024-10-18T23:16:40.668Z (18 days ago)
- Topics: clone, deepclone, underscore
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 10
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
underscore.deepclone [![Build Status](https://travis-ci.org/mateusmaso/underscore.deepclone.svg?branch=master)](https://travis-ci.org/mateusmaso/underscore.deepclone)
=======================This library is an extension for Underscore which allows cloning objects recursively until the pointer tree ends. However, if your object has circular reference it could lead into an infinite loop.
## Features
* Deep clone nested objects.
## Dependencies
* underscore.js (>= 1.5.0)
## Node
```javascript
var _ = require('underscore');
_.mixin(require('underscore.deepclone'));
```## Examples
```javascript
var object = {foo: {bar: 123}};
var objectClone = _.clone(object);
var objectDeepClone = _.deepClone(object);object.foo == objectClone.foo; // true
object.foo == objectDeepClone.foo; // false
```## License
Copyright (c) 2013-2014 Mateus Maso. Released under an MIT license.