@@ -269,7 +269,7 @@ interface ComponentMeta<T> {
269269 }
270270
271271 const componentType = typeChecker . getTypeOfSymbolAtLocation ( _export , symbolNode ) ;
272- const symbolProperties = componentType . getProperties ( ) ?? [ ] ;
272+ const symbolProperties = componentType . getProperties ( ) ;
273273
274274 let _type : ReturnType < typeof getType > | undefined ;
275275 let _props : ReturnType < typeof getProps > | undefined ;
@@ -451,7 +451,7 @@ interface ComponentMeta<T> {
451451 typeChecker : ts . TypeChecker ,
452452 componentPath : string ,
453453 ) {
454- const sourceFile = program ? .getSourceFile ( getMetaFileName ( componentPath ) ) ;
454+ const sourceFile = program . getSourceFile ( getMetaFileName ( componentPath ) ) ;
455455 if ( ! sourceFile ) {
456456 throw 'Could not find main source file' ;
457457 }
@@ -530,8 +530,8 @@ function createSchemaResolvers(
530530
531531 function resolveNestedProperties ( prop : ts . Symbol ) : PropertyMeta {
532532 const subtype = typeChecker . getTypeOfSymbolAtLocation ( prop , symbolNode ) ;
533- let schema : PropertyMetaSchema ;
534- let declarations : Declaration [ ] ;
533+ let schema : PropertyMetaSchema | undefined ;
534+ let declarations : Declaration [ ] | undefined ;
535535
536536 return {
537537 name : prop . getEscapedName ( ) . toString ( ) ,
@@ -557,8 +557,8 @@ function createSchemaResolvers(
557557 const signatures = propType . getCallSignatures ( ) ;
558558 const paramType = signatures [ 0 ] ?. parameters [ 0 ] ;
559559 const subtype = paramType ? typeChecker . getTypeOfSymbolAtLocation ( paramType , symbolNode ) : typeChecker . getAnyType ( ) ;
560- let schema : PropertyMetaSchema ;
561- let declarations : Declaration [ ] ;
560+ let schema : PropertyMetaSchema | undefined ;
561+ let declarations : Declaration [ ] | undefined ;
562562
563563 return {
564564 name : prop . getName ( ) ,
@@ -575,8 +575,8 @@ function createSchemaResolvers(
575575 }
576576 function resolveExposedProperties ( expose : ts . Symbol ) : ExposeMeta {
577577 const subtype = typeChecker . getTypeOfSymbolAtLocation ( expose , symbolNode ) ;
578- let schema : PropertyMetaSchema ;
579- let declarations : Declaration [ ] ;
578+ let schema : PropertyMetaSchema | undefined ;
579+ let declarations : Declaration [ ] | undefined ;
580580
581581 return {
582582 name : expose . getName ( ) ,
@@ -592,8 +592,8 @@ function createSchemaResolvers(
592592 } ;
593593 }
594594 function resolveEventSignature ( call : ts . Signature ) : EventMeta {
595- let schema : PropertyMetaSchema [ ] ;
596- let declarations : Declaration [ ] ;
595+ let schema : PropertyMetaSchema [ ] | undefined ;
596+ let declarations : Declaration [ ] | undefined ;
597597 let subtype = undefined ;
598598 let subtypeStr = '[]' ;
599599 let getSchema = ( ) => [ ] as PropertyMetaSchema [ ] ;
@@ -666,7 +666,7 @@ function createSchemaResolvers(
666666 visited . add ( subtype ) ;
667667
668668 if ( subtype . isUnion ( ) ) {
669- let schema : PropertyMetaSchema [ ] ;
669+ let schema : PropertyMetaSchema [ ] | undefined ;
670670 return {
671671 kind : 'enum' ,
672672 type,
@@ -676,7 +676,7 @@ function createSchemaResolvers(
676676 } ;
677677 }
678678 else if ( typeChecker . isArrayLikeType ( subtype ) ) {
679- let schema : PropertyMetaSchema [ ] ;
679+ let schema : PropertyMetaSchema [ ] | undefined ;
680680 return {
681681 kind : 'array' ,
682682 type,
@@ -690,7 +690,7 @@ function createSchemaResolvers(
690690 && ( subtype . isClassOrInterface ( ) || subtype . isIntersection ( )
691691 || ( subtype as ts . ObjectType ) . objectFlags & ts . ObjectFlags . Anonymous )
692692 ) {
693- let schema : Record < string , PropertyMeta > ;
693+ let schema : Record < string , PropertyMeta > | undefined ;
694694 return {
695695 kind : 'object' ,
696696 type,
@@ -939,7 +939,7 @@ function resolvePropsOption(
939939
940940 for ( const prop of props . properties ) {
941941 if ( ts . isPropertyAssignment ( prop ) ) {
942- const name = prop . name ? .getText ( ast ) ;
942+ const name = prop . name . getText ( ast ) ;
943943 if ( ts . isObjectLiteralExpression ( prop . initializer ) ) {
944944 const defaultProp = prop . initializer . properties . find ( p =>
945945 ts . isPropertyAssignment ( p ) && p . name . getText ( ast ) === 'default'
0 commit comments