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(
2040
2040
// TODO (nice to have) generate runtime property validation
2041
2041
const types = new Set < string > ( )
2042
2042
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' )
2050
2050
}
2051
2051
}
2052
- return Array . from ( types )
2052
+ return types . size ? Array . from ( types ) : [ 'Object' ]
2053
2053
}
2054
2054
case 'TSFunctionType' :
2055
2055
return [ 'Function' ]
You can’t perform that action at this time.
0 commit comments