fix: potential fix of structuredClone for old browsers

This commit is contained in:
divocat
2025-10-26 15:52:08 +03:00
parent 7b116fb435
commit 25f142e039
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -4,6 +4,9 @@
'require uci';
'require ui';
if (typeof structuredClone !== 'function')
globalThis.structuredClone = (obj) => JSON.parse(JSON.stringify(obj));
export * from './validators';
export * from './helpers';
export * from './podkop';
@@ -4737,6 +4737,10 @@ function insertIf(condition, elements) {
function insertIfObj(condition, object) {
return condition ? object : {};
}
// src/main.ts
if (typeof structuredClone !== "function")
globalThis.structuredClone = (obj) => JSON.parse(JSON.stringify(obj));
return baseclass.extend({
ALLOWED_WITH_RUSSIA_INSIDE,
BOOTSTRAP_DNS_SERVER_OPTIONS,