UNPKG

@scandit/web-datacapture-core

Version:

Scandit Data Capture SDK for the Web

1 lines 662 B
function n(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e))return e.map(t=>n(t));if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){let t=new Map;for(let[l,u]of e)t.set(n(l),n(u));return t}if(e instanceof Set){let t=new Set;for(let l of e)t.add(n(l));return t}let r={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=n(e[t]));return r}function a(){return typeof globalThis.structuredClone=="function"?false:(Object.defineProperty(globalThis,"structuredClone",{value:r=>n(r),writable:true,configurable:true}),true)}export{a as structuredClonePolyfill};