File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
packages/compiler-sfc/src Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -2040,16 +2040,16 @@ function inferRuntimeType(
20402040 // TODO (nice to have) generate runtime property validation
20412041 const types = new Set < string > ( )
20422042 for ( const m of node . members ) {
2043- switch ( m . type ) {
2044- case 'TSCallSignatureDeclaration' :
2045- case 'TSConstructSignatureDeclaration' :
2046- types . add ( 'Function' )
2047- break
2048- default :
2049- types . add ( 'Object' )
2043+ if (
2044+ m . type === 'TSCallSignatureDeclaration' ||
2045+ m . type === 'TSConstructSignatureDeclaration'
2046+ ) {
2047+ types . add ( 'Function' )
2048+ } else {
2049+ types . add ( 'Object' )
20502050 }
20512051 }
2052- return Array . from ( types )
2052+ return types . size ? Array . from ( types ) : [ 'Object' ]
20532053 }
20542054 case 'TSFunctionType' :
20552055 return [ 'Function' ]
You can’t perform that action at this time.
0 commit comments