We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7b5608 commit 90c6b40Copy full SHA for 90c6b40
src/utils/structuredClone/structuredClone.ts
@@ -1,4 +1,9 @@
1
-// eslint-disable-next-line node/no-extraneous-import
2
import ungapStructuredClone from '@ungap/structured-clone';
3
4
-export const structuredClone = self.structuredClone ?? ungapStructuredClone;
+let structuredClone;
+if (typeof self !== 'undefined' && self.structuredClone) {
5
+ structuredClone = self.structuredClone;
6
+} else {
7
+ structuredClone = ungapStructuredClone;
8
+}
9
+export { structuredClone };
0 commit comments