@@ -4,9 +4,9 @@ import { toggleActiveAppRecord } from '../core/app-record'
4
4
import type { VueAppInstance } from '../types'
5
5
import { highlight as highlightElement , inspectComponentHighLighter , scrollToComponent , toggleComponentHighLighter , unhighlight as unhighlightElement } from '../core/component-highlighter'
6
6
import { devtoolsContext } from '../state'
7
- import { now as nowFn , parse , stringify } from '../shared'
7
+ import { now as nowFn , stringify } from '../shared'
8
8
import { StateEditor } from '../core/component/state/editor'
9
- import type { InspectorStateEditorPayload } from '../core/component/types'
9
+ import type { ComponentTreeNode , InspectorStateEditorPayload } from '../core/component/types'
10
10
import { addCustomTab } from '../core/custom-tab'
11
11
import type { CustomTab } from '../core/custom-tab/types'
12
12
import { addCustomCommand , removeCustomCommand } from '../core/custom-command'
@@ -82,7 +82,7 @@ export class DevToolsPluginApi {
82
82
} , DevToolsEvents . GET_INSPECTOR_TREE )
83
83
} )
84
84
85
- return stringify ( _payload . rootNodes ) as string
85
+ return _payload . rootNodes as ComponentTreeNode [ ]
86
86
}
87
87
88
88
getInspectorState ( payload : { inspectorId ?: string , nodeId ?: string } = { } ) {
@@ -105,7 +105,7 @@ export class DevToolsPluginApi {
105
105
const state = _payload . state
106
106
107
107
delete state . instance
108
- return stringify ( state ) as string
108
+ return state
109
109
}
110
110
111
111
async editInspectorState ( payload : InspectorStateEditorPayload ) {
@@ -125,10 +125,11 @@ export class DevToolsPluginApi {
125
125
const res = await this . getInspectorTree ( {
126
126
inspectorId,
127
127
} )
128
- apiHooks . callHook ( DevToolsEvents . SEND_INSPECTOR_TREE , stringify ( {
128
+
129
+ apiHooks . callHook ( DevToolsEvents . SEND_INSPECTOR_TREE , {
129
130
inspectorId,
130
- data : parse ( res ) ,
131
- } ) as string )
131
+ data : res ,
132
+ } )
132
133
}
133
134
}
134
135
@@ -139,7 +140,7 @@ export class DevToolsPluginApi {
139
140
inspectorId,
140
141
nodeId : inspector . nodeId ,
141
142
} )
142
- apiHooks . callHook ( DevToolsEvents . SEND_INSPECTOR_STATE , stringify ( { ...parse ( res ) , inspectorId } ) as string )
143
+ apiHooks . callHook ( DevToolsEvents . SEND_INSPECTOR_STATE , { ...res , inspectorId } )
143
144
}
144
145
}
145
146
0 commit comments