Skip to content

Commit

Permalink
fix: is_object check
Browse files Browse the repository at this point in the history
  • Loading branch information
istudyatuni committed Nov 10, 2023
1 parent 43ddace commit fca6462
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/debug/ObjectPrint.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
(is_object(object) && object_entries.length === 0)
function is_object(o) {
return o instanceof Object
return o.constructor === Object
}
function is_array(o) {
return o instanceof Array
Expand All @@ -25,7 +25,7 @@
<li class:is-array={object_is_array}>
<code class:hidden={object_is_array}>{key}:</code>

{#if is_object(value)}
{#if is_object(value) || is_array(value)}
<svelte:self object={value} />
{:else}
<code>{JSON.stringify(value)}</code>
Expand Down

0 comments on commit fca6462

Please sign in to comment.