feat: add debug info
This commit is contained in:
1 parent
45fbc7d25f
commit
5636abbd5b
7 files changed
+72
-12
No files matched your search
@@ -0,0 +1,12 @@
|
||||
<script lang="ts">
|
||||
import Modal from '$lib/components/ui/modal/Modal.svelte'
|
||||
import DebugTree from '$lib/components/util/debug/DebugTree.svelte'
|
||||
|
||||
export let object: any
|
||||
export let open: boolean = false
|
||||
</script>
|
||||
|
||||
<Modal bind:open>
|
||||
<span slot="title">Debug</span>
|
||||
<DebugTree {object} isParent={true} />
|
||||
</Modal>
|
||||
@@ -0,0 +1,24 @@
|
||||
<script lang="ts">
|
||||
export let object: any
|
||||
export let isParent: boolean = false
|
||||
</script>
|
||||
|
||||
<ul class:ml-4={!isParent} class="leading-8">
|
||||
{#each Object.keys(object) as key}
|
||||
<details open={false}>
|
||||
<summary class="cursor-pointer">
|
||||
<code>{key}</code>
|
||||
</summary>
|
||||
{#if typeof object[key] === 'object'}
|
||||
<svelte:self object={object[key]} isParent={false} />
|
||||
{:else}
|
||||
<pre>{object[key]}</pre>
|
||||
{/if}
|
||||
</details>
|
||||
{/each}
|
||||
</ul>
|
||||
|
||||
<style>
|
||||
details {
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user