Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "udc", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "UltraDeepClone - A complete (as possible) deep-clone algorithm that can clone objects with cycles.", | ||
@@ -5,0 +5,0 @@ "main": "udc.js", |
47
udc.js
@@ -18,3 +18,3 @@ (function (root, factory) { | ||
// Node.js has a lot of silly properties on their "TypedArray" implementation | ||
// Node.js has a lot of silly enumeral properties on its "TypedArray" implementation | ||
var typedArrayPropertyFilter = [ | ||
@@ -35,24 +35,27 @@ 'BYTES_PER_ELEMENT', | ||
var cloneFunctions = { | ||
"[object Null]" : primitiveCloner, | ||
"[object Undefined]" : primitiveCloner, | ||
"[object Number]" : primitiveCloner, | ||
"[object String]" : primitiveCloner, | ||
"[object Boolean]" : primitiveCloner, | ||
"[object RegExp]" : makeCloner(cloneRegExp), | ||
"[object Date]" : makeCloner(cloneDate), | ||
"[object Function]" : makeRecursiveCloner(makeCloner(cloneFunction), functionPropertyFilter), | ||
"[object Object]" : makeRecursiveCloner(makeCloner(cloneObject)), | ||
"[object Array]" : makeRecursiveCloner(makeCloner(cloneArray)), | ||
"[object Int8Array]" : typedArrayCloner, | ||
"[object Uint8Array]" : typedArrayCloner, | ||
"[object Uint8ClampedArray]" : typedArrayCloner, | ||
"[object Int16Array]" : typedArrayCloner, | ||
"[object Uint16Array]" : typedArrayCloner, | ||
"[object Int32Array]" : typedArrayCloner, | ||
"[object Uint32Array]" : typedArrayCloner, | ||
"[object Float32Array]" : typedArrayCloner, | ||
"[object Float64Array]" :typedArrayCloner | ||
}; | ||
function typeString (type) { | ||
return '[object ' + type + ']'; | ||
} | ||
var cloneFunctions = {}; | ||
cloneFunctions[typeString('RegExp')] = makeCloner(cloneRegExp); | ||
cloneFunctions[typeString('Date')] = makeCloner(cloneDate); | ||
cloneFunctions[typeString('Function')] = makeRecursiveCloner(makeCloner(cloneFunction), functionPropertyFilter); | ||
cloneFunctions[typeString('Object')] = makeRecursiveCloner(makeCloner(cloneObject)); | ||
cloneFunctions[typeString('Array')] = makeRecursiveCloner(makeCloner(cloneArray)); | ||
['Null', 'Undefined', 'Number', 'String', 'Boolean'] | ||
.map(typeString) | ||
.forEach(function (type) { | ||
cloneFunctions[type] = primitiveCloner; | ||
}); | ||
['Int8Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array', 'Uint16Array', | ||
'Int32Array', 'Uint32Array', 'Float32Array', 'Float64Array'] | ||
.map(typeString) | ||
.forEach(function (type) { | ||
cloneFunctions[type] = typedArrayCloner; | ||
}); | ||
function makeArguments (numberOfArgs) { | ||
@@ -59,0 +62,0 @@ var letters = []; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14757
306