{"ScriptPreparationCode":"var voucher = {\r\n \u0022single\u0022: false,\r\n \u0022applyOverTaxes\u0022: false,\r\n \u0022discountType\u0022: \u00221\u0022,\r\n \u0022value\u0022: 100,\r\n \u0022minimumAmount\u0022: 0,\r\n \u0022quantity\u0022: 1,\r\n \u0022suffixLength\u0022: 8,\r\n \u0022code\u0022: \u0022IF5R0AFX\u0022,\r\n \u0022vertical\u0022: true,\r\n \u0022allowedPaymentMethods\u0022: null,\r\n \u0022allowedBanks\u0022: null,\r\n \u0022types\u0022: undefined,\r\n \u0022partners\u0022: \u0022Many\u0022,\r\n \u0022startDate\u0022: \u00222020-10-21T00:00:00.000Z\u0022,\r\n \u0022endDate\u0022: \u00222020-10-21T00:00:00.000Z\u0022,\r\n \u0022applyed\u0022: false\r\n}\r\n","TestCases":[{"Name":"structuredClone()","Code":"var newObj = structuredClone(voucher)","IsDeferred":false},{"Name":"spread syntax","Code":"var newObj = {...voucher}","IsDeferred":false},{"Name":"Object.assign","Code":"var newObj = Object.assign({}, voucher)","IsDeferred":false},{"Name":"Object.fromEntries","Code":"var newObj = Object.fromEntries(Object.entries(voucher))","IsDeferred":false},{"Name":"JSON","Code":"// loses the \u0022types\u0022 property\r\nvar newObj = JSON.parse(JSON.stringify(voucher))","IsDeferred":false},{"Name":"Cursed Proxy","Code":"// this registers as surprisingly performant for some reason, but keep in mind i didn\u0027t benchmark\r\n// usage, only creation, so in reality this could potentially not be performant when setting/getting.\r\n// either way this is really scuffed so you probably shouldn\u0027t take this approach\r\nvar newObject = new Proxy({}, {\r\n get (o, p) { return p in o ? o[p] : o[p] ??= voucher[p] },\r\n set (o, p, v) { o[p] = v; return true }\r\n})","IsDeferred":false}]}