@@ -40,7 +40,7 @@ export default defineComponent({
40
40
] ) ,
41
41
) ,
42
42
} as {
43
- [ key in ModelValueProp ] : { }
43
+ [ key in ModelValueProp ] : object
44
44
} & { mode : { type : PropType < Mode > } } & {
45
45
[ key in typeof boolAttrs [ number ] ] : {
46
46
type : PropType < boolean >
@@ -90,7 +90,7 @@ export default defineComponent({
90
90
emit ( 'update:mode' , mode )
91
91
}
92
92
93
- const mergeFunction = ( previousValue : Function , currentValue : Function ) => ( ...args : any ) => {
93
+ const mergeFunction = ( previousValue : ( ... args : any ) => unknown , currentValue : ( ... args : any ) => unknown ) => ( ...args : any ) => {
94
94
previousValue ( ...args )
95
95
currentValue ( ...args )
96
96
}
@@ -144,7 +144,7 @@ export default defineComponent({
144
144
watch (
145
145
( ) => props . mode ,
146
146
( mode ) => {
147
- // `jsonEditor.value` could be `undefined` in Vue 2.6 (dev environment)
147
+ // `jsonEditor.value` could be `undefined` in Vue 2.6
148
148
jsonEditor . value ?. updateProps ( {
149
149
mode,
150
150
} )
@@ -154,7 +154,7 @@ export default defineComponent({
154
154
watch (
155
155
( ) => Array . from ( boolAttrs , boolAttr => props [ boolAttr ] ) ,
156
156
( values ) => {
157
- jsonEditor . value . updateProps (
157
+ jsonEditor . value ? .updateProps (
158
158
Object . fromEntries ( Array . from ( values , ( v , i ) => [ boolAttrs [ i ] , v ] ) . filter ( ( [ , v ] ) => v !== undefined ) ) ,
159
159
)
160
160
} ,
@@ -165,16 +165,16 @@ export default defineComponent({
165
165
( newAttrs ) => {
166
166
// Functions need to be merged again
167
167
const defaultFunctionAttrs : {
168
- onChange ?: Function
169
- onChangeMode ?: Function
168
+ onChange ?: ( ... args : any ) => unknown
169
+ onChangeMode ?: ( ... args : any ) => unknown
170
170
} = { }
171
171
if ( newAttrs . onChange ) {
172
172
defaultFunctionAttrs . onChange = onChange
173
173
}
174
174
if ( newAttrs . onChangeMode ) {
175
175
defaultFunctionAttrs . onChangeMode = onChangeMode
176
176
}
177
- jsonEditor . value . updateProps (
177
+ jsonEditor . value ? .updateProps (
178
178
Object . getOwnPropertyNames ( defaultFunctionAttrs ) . length > 0
179
179
? conclude ( [ newAttrs , defaultFunctionAttrs ] , {
180
180
type : Object ,
@@ -191,7 +191,7 @@ export default defineComponent({
191
191
expose ?.( { jsonEditor } )
192
192
193
193
onUnmounted ( ( ) => {
194
- jsonEditor . value . destroy ( )
194
+ jsonEditor . value ? .destroy ( )
195
195
} )
196
196
197
197
onMounted ( ( ) => {
0 commit comments