Fix build version of the project because of web workers

This commit is contained in:
Eric NGUYEN 2022-08-17 17:47:16 +02:00
parent 2945febd91
commit c7bc77b08f
4 changed files with 4 additions and 5 deletions

View file

@ -1,25 +0,0 @@
onmessage = (e) => {
const data = JSON.stringify(e.data.editorState, getCircularReplacer(), e.data.spaces);
postMessage(data);
};
const getCircularReplacer = () => {
const seen = new WeakSet();
return (key, value) => {
if (key === 'parent') {
return;
}
if (key === 'SelectedContainer') {
return;
}
if (typeof value === 'object' && value !== null) {
if (seen.has(value)) {
return;
}
seen.add(value);
}
return value;
};
};