Fix build version of the project because of web workers
This commit is contained in:
parent
2945febd91
commit
c7bc77b08f
4 changed files with 4 additions and 5 deletions
|
@ -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;
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue