Skip to content

Commit

Permalink
deepCopy docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tborychowski committed Jun 14, 2024
1 parent 18b2602 commit 6af59f9
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 99 deletions.
16 changes: 16 additions & 0 deletions docs-src/components/utils/functions/deep-copy.svelte
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);
&lt;/script>
`;
</script>
1 change: 1 addition & 0 deletions docs-src/components/utils/functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export { default as alignItem } from './align-item.svelte';
export { default as animate } from './animate.svelte';
export { default as blink } from './blink.svelte';
export { default as debounce } from './debounce.svelte';
export { default as deepCopy } from './deep-copy.svelte';
export { default as empty } from './empty.svelte';
export { default as isset } from './isset.svelte';
export { default as formatDate } from './format-date.svelte';
Expand Down
Loading

0 comments on commit 6af59f9

Please sign in to comment.