Skip to content
This repository was archived by the owner on Feb 1, 2026. It is now read-only.

Commit 2937cf5

Browse files
committed
fix(inspector): simplify copy functionality by removing unnecessary type checks for string values
1 parent 307e1d2 commit 2937cf5

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

client/components/inspector/Tree.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script setup lang="ts">
2-
import { Node } from 'three/webgpu'
32
import { computed, ref } from 'vue'
43
import type { InspectorNode } from '~/client/types'
54
@@ -59,7 +58,7 @@ const copyPath = async (path: string): Promise<void> => {
5958
6059
const copyProp = async (node: InspectorNode): Promise<void> => {
6160
try {
62-
const propString = `:${node.path.replace(/\./g, '-')}="${typeof node.value === 'string' ? node.value : JSON.stringify(node.value)}"`
61+
const propString = `:${node.path.replace(/\./g, '-')}="${JSON.stringify(node.value)}"`
6362
await navigator.clipboard.writeText(propString)
6463
}
6564
catch (error) {
@@ -80,7 +79,7 @@ const copyPropAsArray = async (node: InspectorNode): Promise<void> => {
8079
8180
const copyValue = async (value: unknown): Promise<void> => {
8281
try {
83-
const stringValue = typeof value === 'string' ? value : JSON.stringify(value)
82+
const stringValue = JSON.stringify(value)
8483
await navigator.clipboard.writeText(stringValue)
8584
}
8685
catch (error) {

0 commit comments

Comments
 (0)