{"ScriptPreparationCode":"function C() {}\r\nvar MyObject = {\r\n data: {\r\n \u0022objectId\u0022: \u0022sensitive\u0022,\r\n \u0022entity\u0022: \u0022sensitive\u0022,\r\n \u0022layer\u0022: \u0022sensitive\u0022,\r\n \u0022status\u0022: \u0022sensitive\u0022,\r\n \u0022version\u0022: \u0022sensitive\u0022,\r\n \u0022latestVersion\u0022: \u0022sensitive\u0022,\r\n \u0022modelVersion\u0022: \u0022sensitive\u0022,\r\n \u0022createdAt\u0022: \u0022sensitive\u0022,\r\n \u0022updatedAt\u0022: \u0022sensitive\u0022,\r\n \u0022createdBy\u0022: \u0022sensitive\u0022,\r\n \u0022updatedBy\u0022: \u0022sensitive\u0022,\r\n \u0022revisionId\u0022: \u0022sensitive\u0022,\r\n \u0022updatedByBundleId\u0022: \u0022sensitive\u0022,\r\n \u0022updatedByRequestTraceId\u0022: \u0022sensitive\u0022,\r\n \u0022source\u0022: \u0022sensitive\u0022,\r\n \u0022sourceCommercialRegisterCode\u0022: \u0022sensitive\u0022,\r\n \u0022sourceCommercialRegisterCodeIssuer\u0022: \u0022sensitive\u0022,\r\n \u0022contactId\u0022: \u0022sensitive\u0022,\r\n \u0022contactStatus\u0022: \u0022sensitive\u0022,\r\n \u0022contactAddress\u0022: {\r\n \u0022country\u0022: \u0022sensitive\u0022,\r\n \u0022city\u0022: \u0022sensitive\u0022,\r\n \u0022countryIsoCode\u0022: \u0022sensitive\u0022,\r\n \u0022addressType\u0022: \u0022sensitive\u0022,\r\n \u0022street\u0022: \u0022sensitive\u0022,\r\n \u0022postalCode\u0022: \u0022sensitive\u0022,\r\n \u0022houseNumber\u0022: \u0022235\u0022\r\n },\r\n \u0022dateOfBirth\u0022: \u0022sensitive\u0022,\r\n \u0022email\u0022: \u0022sensitive\u0022,\r\n \u0022nickName\u0022: \u0022sensitive\u0022,\r\n \u0022firstName\u0022: \u0022sensitive\u0022,\r\n \u0022identityId\u0022: \u0022sensitive\u0022,\r\n \u0022initials\u0022: \u0022sensitive\u0022,\r\n \u0022lastName\u0022: \u0022sensitive\u0022,\r\n \u0022nationality\u0022: \u0022sensitive\u0022,\r\n \u0022nationalityCountryCode\u0022: \u0022sensitive\u0022,\r\n \u0022phoneNumber\u0022: \u0022sensitive\u0022,\r\n \u0022isPartner\u0022: false\r\n },\r\n a: 1,\r\n b: \u0027b\u0027,\r\n c: new C(),\r\n d: [1, 2, 3, new C()],\r\n e: {\r\n a: 1,\r\n b: \u0027b\u0027,\r\n c: new C(),\r\n d: [1, 2, 3, new C()],\r\n },\r\n f: [1, 2, 3, {\r\n a: 1,\r\n b: \u0027b\u0027,\r\n c: new C(),\r\n d: [1, 2, 3, new C()],\r\n }],\r\n g: Date(),\r\n h: new Set([1, 2, 3]),\r\n i: new Map([[\u0027a\u0027, 1], [\u0027b\u0027, 2], [\u0027c\u0027, 3]]),\r\n nested: {\r\n description: \u0027Creates a deep copy of source, which should be an object or an array.\u0027,\r\n myNumber: 123456789,\r\n myBoolean: true,\r\n jayson: {\r\n stringify: \u0027JSON.stringify() method converts a JavaScript value to a JSON string....\u0027,\r\n parse: \u0027JSON.parse() method parses a JSON string...\u0027\r\n }\r\n }\r\n};\r\n\r\nvar myCopy = null;\r\n\r\nvar jsondiffpatchClone = jsondiffpatch.clone;\r\nvar rfdcClone = rfdc();\r\n\r\n///////////////////////////////////////////////////////////////////\r\nfunction recursiveDeepCopy(o) {\r\n var newO,\r\n i;\r\n \r\n if (typeof o !== \u0027object\u0027) {\r\n return o;\r\n }\r\n if (!o) {\r\n return o;\r\n }\r\n \r\n if (\u0027[object Array]\u0027 === Object.prototype.toString.apply(o)) {\r\n newO = [];\r\n for (i = 0; i \u003C o.length; i \u002B= 1) {\r\n newO[i] = recursiveDeepCopy(o[i]);\r\n }\r\n return newO;\r\n }\r\n \r\n newO = {};\r\n for (i in o) {\r\n if (o.hasOwnProperty(i)) {\r\n newO[i] = recursiveDeepCopy(o[i]);\r\n }\r\n }\r\n return newO;\r\n }\r\n//////////////////////////////////////////////////////////////////\r\n// Use https://www.npmjs.com/package/fastest-json-copy\r\n// Instead of the code below! It is the same thing, just minified.\r\nvar isArray=Array.isArray;function fastestJsonCopy(r){if(!r)return r;if(isArray(r)){for(var e=[],o=r.length,t=0;t\u003Co;t\u002B\u002B)e.push(fastestJsonCopy(r[t]));return e}if(\u0022object\u0022==typeof r){var y=Object.keys(r),a=(o=y.length,{});for(t=0;t\u003Co;t\u002B\u002B){var c=y[t];a[c]=fastestJsonCopy(r[c])}return a}return r}\r\n\r\nfunction makePlain(instance) {\r\n if (!instance) {\r\n return instance\r\n }\r\n if (instance instanceof Array) {\r\n const plain = []\r\n for (let i = 0; i \u003C instance.length; i\u002B\u002B) {\r\n plain[i] = makePlain(instance[i])\r\n }\r\n return plain\r\n }\r\n if (instance.constructor === Object) {\r\n const plain = {}\r\n const keys = Object.keys(instance)\r\n for (let i = 0; i \u003C keys.length; i\u002B\u002B) {\r\n plain[keys[i]] = makePlain(instance[keys[i]])\r\n }\r\n return plain\r\n }\r\n const isNative = instance.constructor.toString().indexOf(\u0027native code\u0027) !== -1\r\n if (isNative) {\r\n return instance\r\n }\r\n const plain = {}\r\n const keys = Object.keys(instance)\r\n for (let i = 0; i \u003C keys.length; i\u002B\u002B) {\r\n plain[keys[i]] = makePlain(instance[keys[i]])\r\n }\r\n return plain\r\n}","TestCases":[{"Name":"lodash cloneDeep","Code":"myCopy = _.cloneDeep(MyObject);","IsDeferred":false},{"Name":"JSON.parse(JSON.stringify())","Code":"myCopy = JSON.parse(JSON.stringify(MyObject));","IsDeferred":false},{"Name":"recursiveDeepCopy","Code":"myCopy = recursiveDeepCopy(MyObject);","IsDeferred":false},{"Name":"fastest-json-copy npm package","Code":"myCopy = fastestJsonCopy(MyObject);","IsDeferred":false},{"Name":"jsondiffpatch.clone()","Code":"myCopy = jsondiffpatchClone(MyObject);","IsDeferred":false},{"Name":"rfdc","Code":"myCopy = rfdcClone(MyObject);","IsDeferred":false},{"Name":"makePlain","Code":"myCopy = makePlain(MyObject);","IsDeferred":false}]}