@@ -51,17 +51,16 @@ export default class AstPackage extends AstModule {
5151 // The scoped package name. (E.g. "@microsoft/api-extractor")
5252 this . name = context . packageName ;
5353
54- const exportSymbols : ts . Symbol [ ] = this . typeChecker . getExportsOfModule ( this . declarationSymbol ) ;
55- if ( exportSymbols ) {
56- for ( const exportSymbol of exportSymbols ) {
54+ const exportSymbols : ts . Symbol [ ] = this . typeChecker . getExportsOfModule ( this . declarationSymbol ) || [ ] ;
55+
56+ for ( const exportSymbol of exportSymbols ) {
5757 this . processModuleExport ( exportSymbol ) ;
5858
59- const followedSymbol : ts . Symbol = this . followAliases ( exportSymbol ) ;
60- this . _exportedNormalizedSymbols . push ( {
61- exportedName : exportSymbol . name ,
62- followedSymbol : followedSymbol
63- } ) ;
64- }
59+ const followedSymbol : ts . Symbol = TypeScriptHelpers . followAliases ( exportSymbol , this . typeChecker ) ;
60+ this . _exportedNormalizedSymbols . push ( {
61+ exportedName : exportSymbol . name ,
62+ followedSymbol : followedSymbol
63+ } ) ;
6564 }
6665 }
6766
@@ -77,7 +76,7 @@ export default class AstPackage extends AstModule {
7776 * the string "MyClass".
7877 */
7978 public tryGetExportedSymbolName ( symbol : ts . Symbol ) : string | undefined {
80- const followedSymbol : ts . Symbol = this . followAliases ( symbol ) ;
79+ const followedSymbol : ts . Symbol = TypeScriptHelpers . followAliases ( symbol , this . typeChecker ) ;
8180 for ( const exportedSymbol of this . _exportedNormalizedSymbols ) {
8281 if ( exportedSymbol . followedSymbol === followedSymbol ) {
8382 return exportedSymbol . exportedName ;
0 commit comments