Skip to content

Commit cbedf44

Browse files
committed
chore: update
1 parent 1663a9a commit cbedf44

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

examples/prototype-data-inspector/src/spa/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function queryAppend(path: string): void {
8383
<div class="flex items-center gap-1.5 shrink-0 select-none border-b border-base py1 px3">
8484
<span class="i-ph-crosshair-duotone text-base color-primary" />
8585
<span class="color-primary font-semibold">Data Inspector</span>
86-
<span class="op-fade text-sm">Inspect server side data/objects interactively</span>
86+
<span class="op-fade text-xs">Inspect server side data/objects interactively</span>
8787
<DisplayBadge
8888
v-if="connection.status !== 'connected'"
8989
class="flex items-center gap-1.5 py-1 text-xs select-none capitalize"

examples/prototype-data-inspector/src/spa/composables/display-transform.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function walk(value: unknown): Walked {
8282
switch (type) {
8383
case 'function': {
8484
const name = typeof obj.name === 'string' && obj.name !== '(anonymous)' ? obj.name : ''
85-
return { value: {}, badge: badgeFor('function', name ? `fn ${name}` : 'Function') }
85+
return { value: name ? `<function ${name}>` : '<function>', badge: badgeFor('function', 'Function') }
8686
}
8787
case 'Map': {
8888
const inner = walk(obj.value ?? obj.entries ?? {})
@@ -98,14 +98,17 @@ function walk(value: unknown): Walked {
9898
case 'bigint':
9999
case 'symbol':
100100
return { value: obj.value, badge: badgeFor(type, type === 'bigint' ? 'BigInt' : type === 'symbol' ? 'Symbol' : type) }
101-
case 'Error':
102-
return { value: `${obj.name}: ${obj.message}`, badge: badgeFor('Error') }
101+
case 'Error':{
102+
const clone = { ...obj }
103+
delete clone.$type
104+
return { value: clone, badge: badgeFor('Error') }
105+
}
103106
case 'getter-error':
104107
return { value: String(obj.message ?? ''), badge: badgeFor('getter-error', 'getter threw') }
105108
default:
106109
// Promise, WeakMap, TypedArray tags, ... - opaque stubs
107110
return {
108-
value: {},
111+
value: `<${type}>`,
109112
badge: badgeFor(type, typeof obj.length === 'number' ? `${type}(${obj.length})` : type),
110113
}
111114
}

0 commit comments

Comments
 (0)