-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18b2602
commit 6af59f9
Showing
3 changed files
with
122 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Util id="deepCopy" name="deepCopy(object)" {example}> | ||
<p>Creates a deep copy of an object. | ||
Because the native <em>structuredClone</em> is not only oddly named, but also extremely slow.</p> | ||
</Util> | ||
|
||
<script> | ||
import Util from '../Util.svelte'; | ||
const example = ` | ||
<script> | ||
const o1 = {a: 1, b: {c: 2}, d: [3, 4]}; | ||
const o2 = deepCopy(o1); | ||
</script> | ||
`; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.