Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
rpm-mcarman b9f7ec4306 First Commit vor 3 Jahren
..
node_modules/kind-of First Commit vor 3 Jahren
LICENSE First Commit vor 3 Jahren
README.md First Commit vor 3 Jahren
index.js First Commit vor 3 Jahren
package.json First Commit vor 3 Jahren
utils.js First Commit vor 3 Jahren

README.md

clone-deep NPM version Build Status

Recursively (deep) clone JavaScript native types, like Object, Array, RegExp, Date as well as primitives.

The instanceClone function is invoked to clone objects that are not “plain” objects (as defined by isPlainObject) if it is provided. If instanceClone is not specified, it will not attempt to clone non-plain objects, and will copy the object reference.

Install

Install with npm

$ npm i clone-deep --save

Usage

var cloneDeep = require('clone-deep');

var obj = {a: 'b'};
var arr = [obj];

var copy = cloneDeep(arr);
obj.c = 'd';

console.log(copy);
//=> [{a: 'b'}]

console.log(arr);
//=> [{a: 'b', c: 'd'}]

Other object utils

  • assign-deep: Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target… more | homepage
  • extend-shallow: Extend an object with the properties of additional objects. node.js/javascript util. | homepage
  • merge-deep: Recursively merge values in a javascript object. | homepage
  • mixin-deep: Deeply mix the properties of objects into the first object. Like merge-deep, but doesn’t clone. | homepage
  • mixin-object: Mixin the own and inherited properties of other objects onto the first object. Pass an… more | homepage
  • shallow-clone: Make a shallow clone of an object, array or primitive. | homepage

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

Based on mout’s implementation of deepClone.

License

Copyright © 2014-2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb on December 23, 2015.