File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -262,7 +262,7 @@ export class ExportAnalyzer {
262262 const specifier : ts . TypeNode | ts . Expression | undefined = ts . isImportTypeNode ( importOrExportDeclaration )
263263 ? importOrExportDeclaration . argument
264264 : importOrExportDeclaration . moduleSpecifier ;
265- const mode : ts . StringLiteralLike =
265+ const mode : ts . ModuleKind . CommonJS | ts . ModuleKind . ESNext | undefined =
266266 specifier && ts . isStringLiteralLike ( specifier )
267267 ? TypeScriptInternals . getModeForUsageLocation ( importOrExportDeclaration . getSourceFile ( ) , specifier )
268268 : undefined ;
@@ -872,7 +872,7 @@ export class ExportAnalyzer {
872872 exportSymbol : ts . Symbol
873873 ) : AstModule {
874874 const moduleSpecifier : string = this . _getModuleSpecifier ( importOrExportDeclaration ) ;
875- const mode : ts . StringLiteralLike | undefined =
875+ const mode : ts . ModuleKind . CommonJS | ts . ModuleKind . ESNext | undefined =
876876 importOrExportDeclaration . moduleSpecifier &&
877877 ts . isStringLiteralLike ( importOrExportDeclaration . moduleSpecifier )
878878 ? TypeScriptInternals . getModeForUsageLocation (
Original file line number Diff line number Diff line change @@ -84,10 +84,10 @@ export class TypeScriptInternals {
8484 public static getResolvedModule (
8585 sourceFile : ts . SourceFile ,
8686 moduleNameText : string ,
87- mode : ts . StringLiteralLike | undefined
87+ mode : ts . ModuleKind . CommonJS | ts . ModuleKind . ESNext | undefined
8888 ) : ts . ResolvedModuleFull | undefined {
8989 // Compiler internal:
90- // https://github.com/microsoft/TypeScript/blob/v3.2 .2/src/compiler/utilities.ts#L218
90+ // https://github.com/microsoft/TypeScript/blob/v4.7 .2/src/compiler/utilities.ts#L161
9191
9292 return ( ts as any ) . getResolvedModule ( sourceFile , moduleNameText , mode ) ;
9393 }
@@ -97,12 +97,12 @@ export class TypeScriptInternals {
9797 */
9898 public static getModeForUsageLocation (
9999 file : { impliedNodeFormat ?: ts . SourceFile [ 'impliedNodeFormat' ] } ,
100- usage : ts . StringLiteralLike
101- ) {
100+ usage : ts . StringLiteralLike | undefined
101+ ) : ts . ModuleKind . CommonJS | ts . ModuleKind . ESNext | undefined {
102102 // Compiler internal:
103103 // https://github.com/microsoft/TypeScript/blob/v4.7.2/src/compiler/program.ts#L568
104104
105- return ( ts as any ) . getModeForUsageLocation ( file , usage ) ;
105+ return ( ts as any ) . getModeForUsageLocation ?. ( file , usage ) ;
106106 }
107107
108108 /**
You can’t perform that action at this time.
0 commit comments