From fff0645045fdb1bbcc900c3e2a325650ab134ae4 Mon Sep 17 00:00:00 2001 From: Eric NGUYEN Date: Wed, 12 Oct 2022 17:16:08 +0200 Subject: [PATCH] Fix serialization AGAIN in web workers --- public/workers/message_packet_worker.js | 2 ++ public/workers/message_worker.js | 20 +++++--------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/public/workers/message_packet_worker.js b/public/workers/message_packet_worker.js index 7bdf791..bd60fc8 100644 --- a/public/workers/message_packet_worker.js +++ b/public/workers/message_packet_worker.js @@ -84,6 +84,8 @@ function GetCircularReplacerKeepDataStructure() if (key === 'linkedContainers') { return Array.from(value); } + + return value; }; } diff --git a/public/workers/message_worker.js b/public/workers/message_worker.js index a5399f0..62465b4 100644 --- a/public/workers/message_worker.js +++ b/public/workers/message_worker.js @@ -34,26 +34,16 @@ function GetCircularReplacerKeepDataStructure() } if (key === 'containers') { - return [...value.entries()].map((keyPair) => { - return { - Key: keyPair[0], - Value: keyPair[1] - }; - }); + const containers = Array.from(value).map(([Key, Value]) => ({ Key, Value })); + return containers; } if (key === 'symbols') { - return [...value.entries()].map((keyPair) => { - return { - Key: keyPair[0], - Value: keyPair[1] - }; - }); + const symbols = Array.from(value).map(([Key, Value]) => ({ Key, Value })); + return symbols; } - if (key === 'linkedContainers') { - return Array.from(value); - } + return value; }; }