diff --git a/packages/dnb-eufemia/.eslintrc b/packages/dnb-eufemia/.eslintrc index a194ca442d2..837a3601a44 100644 --- a/packages/dnb-eufemia/.eslintrc +++ b/packages/dnb-eufemia/.eslintrc @@ -143,6 +143,13 @@ } ] } + ], + "no-restricted-globals": [ + "error", + { + "name": "structuredClone", + "message": "Import `structuredClone` from '@ungap/structured-clone' instead." + } ] } }, diff --git a/packages/dnb-eufemia/src/extensions/forms/Form/data-context/useData.tsx b/packages/dnb-eufemia/src/extensions/forms/Form/data-context/useData.tsx index 33e1d7ded1d..e525e7c75e0 100644 --- a/packages/dnb-eufemia/src/extensions/forms/Form/data-context/useData.tsx +++ b/packages/dnb-eufemia/src/extensions/forms/Form/data-context/useData.tsx @@ -18,6 +18,12 @@ import DataContext, { } from '../../DataContext/Context' import { SharedAttachments } from '../../DataContext/Provider' +/** + * Deprecated, as it is supported by all major browsers and Node.js >=v18 + * So its a question of time, when we will remove this polyfill + */ +import structuredClone from '@ungap/structured-clone' + type PathImpl = P extends `${infer Key}/${infer Rest}` ? Key extends keyof T ? Rest extends ''