File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -1625,15 +1625,8 @@ namespace ts {
1625
1625
}
1626
1626
1627
1627
function hasExportDeclarations ( node : ModuleDeclaration | SourceFile ) : boolean {
1628
- const body = node . kind === SyntaxKind . SourceFile ? node : node . body ;
1629
- if ( body && ( body . kind === SyntaxKind . SourceFile || body . kind === SyntaxKind . ModuleBlock ) ) {
1630
- for ( const stat of ( < BlockLike > body ) . statements ) {
1631
- if ( stat . kind === SyntaxKind . ExportDeclaration || stat . kind === SyntaxKind . ExportAssignment ) {
1632
- return true ;
1633
- }
1634
- }
1635
- }
1636
- return false ;
1628
+ const body = isSourceFile ( node ) ? node : tryCast ( node . body , isModuleBlock ) ;
1629
+ return ! ! body && body . statements . some ( s => isExportDeclaration ( s ) || isExportAssignment ( s ) ) ;
1637
1630
}
1638
1631
1639
1632
function setExportContextFlag ( node : ModuleDeclaration | SourceFile ) {
You can’t perform that action at this time.
0 commit comments