PATH:
usr
/
local
/
lib
/
node_modules
/
bower
/
lib
/
node_modules
/
bower-config
/
node_modules
/
mout
/
lang
var clone = require('./clone'); var forOwn = require('../object/forOwn'); var kindOf = require('./kindOf'); var isPlainObject = require('./isPlainObject'); /** * Recursively clone native types. */ function deepClone(val, instanceClone) { switch ( kindOf(val) ) { case 'Object': return cloneObject(val, instanceClone); case 'Array': return cloneArray(val, instanceClone); default: return clone(val); } } function cloneObject(source, instanceClone) { if (isPlainObject(source)) { var out = {}; forOwn(source, function(val, key) { this[key] = deepClone(val, instanceClone); }, out); return out; } else if (instanceClone) { return instanceClone(source); } else { return source; } } function cloneArray(arr, instanceClone) { var out = [], i = -1, n = arr.length, val; while (++i < n) { out[i] = deepClone(arr[i], instanceClone); } return out; } module.exports = deepClone;
[-] isBoolean.js
[edit]
[-] isInteger.js
[edit]
[-] isRegExp.js
[edit]
[-] ctorApply.js
[edit]
[-] toString.js
[edit]
[-] toArray.js
[edit]
[-] toNumber.js
[edit]
[-] is.js
[edit]
[+]
..
[-] inheritPrototype.js
[edit]
[-] GLOBAL.js
[edit]
[-] deepClone.js
[edit]
[-] isFinite.js
[edit]
[-] isObject.js
[edit]
[-] isUndefined.js
[edit]
[-] isDate.js
[edit]
[-] isPlainObject.js
[edit]
[-] isArguments.js
[edit]
[-] kindOf.js
[edit]
[-] isPrimitive.js
[edit]
[-] isString.js
[edit]
[-] isNull.js
[edit]
[-] isNumber.js
[edit]
[-] deepEquals.js
[edit]
[-] isNaN.js
[edit]
[-] isnt.js
[edit]
[-] isArray.js
[edit]
[-] isKind.js
[edit]
[-] isEmpty.js
[edit]
[-] defaults.js
[edit]
[-] createObject.js
[edit]
[-] isFunction.js
[edit]
[-] clone.js
[edit]