From: Jérôme Benoit Date: Sat, 30 Dec 2023 11:00:01 +0000 (+0100) Subject: perf: use structuredClone() for cloning X-Git-Tag: v3.1.13~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d4efe3b82d415e455c8e6c300f2a6845ff3edc80;p=poolifier.git perf: use structuredClone() for cloning Signed-off-by: Jérôme Benoit --- diff --git a/src/utils.ts b/src/utils.ts index 7d6309d5..c8aed442 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -282,8 +282,8 @@ export const once = ( } } -const clone = (object: T): T => { - return JSON.parse(JSON.stringify(object)) as T +const clone = (object: T): T => { + return structuredClone(object) } export const buildInternalWorkerChoiceStrategyOptions = (