fix: structured clone (#2483)

This commit is contained in:
Anshuman Pandey
2024-04-18 21:36:22 +05:30
committed by GitHub
parent 0b26475934
commit 83b9400479

View File

@@ -1,11 +1,12 @@
import structuredClonePolyfill from "@ungap/structured-clone";
let structuredCloneExport = structuredClone;
let structuredCloneExport: typeof structuredClonePolyfill;
if (typeof structuredCloneExport === "undefined") {
// @ts-expect-error
if (typeof structuredClone === "undefined") {
structuredCloneExport = structuredClonePolyfill;
} else {
// @ts-expect-error
structuredCloneExport = structuredClone;
}
// export default structuredCloneExport;
export { structuredCloneExport as structuredClone };