repositories
/
poolifier.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
20e4948
)
perf: use structuredClone() for cloning
author
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Sat, 30 Dec 2023 11:00:01 +0000
(12:00 +0100)
committer
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Sat, 30 Dec 2023 11:00:01 +0000
(12:00 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/utils.ts
patch
|
blob
|
blame
|
history
diff --git
a/src/utils.ts
b/src/utils.ts
index 7d6309d539e22e65b08b64b55924b6df8a51de74..c8aed4421bb8f7f9a8262683b02cefa4b6a6ff5b 100644
(file)
--- a/
src/utils.ts
+++ b/
src/utils.ts
@@
-282,8
+282,8
@@
export const once = <T, A extends any[], R>(
}
}
-const clone = <T
extends object
>(object: T): T => {
- return
JSON.parse(JSON.stringify(object)) as T
+const clone = <T>(object: T): T => {
+ return
structuredClone<T>(object)
}
export const buildInternalWorkerChoiceStrategyOptions = (