From 015f34040633618656bfbad648f7303c0b883e2d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 7 Sep 2023 02:01:56 +0200 Subject: [PATCH] perf: convert deepClone() to arrow function MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/utils/Utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index c29f8d15..14a6aa69 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -216,11 +216,11 @@ type CloneableData = type FormatKey = (key: string) => string; -function deepClone( +const deepClone = ( value: I, formatKey?: FormatKey, refs: Map = new Map(), -): O { +): O => { const ref = refs.get(value); if (ref !== undefined) { return ref; @@ -249,7 +249,7 @@ function deepClone( ); } return clone as O; -} +}; export const cloneObject = (object: T): T => { return deepClone(object as CloneableData) as T; -- 2.34.1