mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 16:17:50 +00:00
Bump to v4.0.0.
This commit is contained in:
23
cloneDeep.js
Normal file
23
cloneDeep.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import baseClone from './internal/baseClone';
|
||||
|
||||
/**
|
||||
* This method is like `_.clone` except that it recursively clones `value`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Lang
|
||||
* @param {*} value The value to recursively clone.
|
||||
* @returns {*} Returns the deep cloned value.
|
||||
* @example
|
||||
*
|
||||
* var objects = [{ 'a': 1 }, { 'b': 2 }];
|
||||
*
|
||||
* var deep = _.cloneDeep(objects);
|
||||
* console.log(deep[0] === objects[0]);
|
||||
* // => false
|
||||
*/
|
||||
function cloneDeep(value) {
|
||||
return baseClone(value, true);
|
||||
}
|
||||
|
||||
export default cloneDeep;
|
||||
Reference in New Issue
Block a user