@@ -27,9 +27,6 @@ namespace ts.codefix {
27
27
readonly importDecl : ImportDeclaration ;
28
28
readonly originSourceFile : SourceFile
29
29
}
30
- function isImportDeclaration ( node : Node ) : node is ImportDeclaration {
31
- return node . kind === SyntaxKind . ImportDeclaration ;
32
- }
33
30
34
31
function getInfo ( sourceFile : SourceFile , context : CodeFixContext | CodeFixAllContext , pos : number ) : Info | undefined {
35
32
const node = getTokenAtPosition ( sourceFile , pos ) ;
@@ -49,9 +46,9 @@ namespace ts.codefix {
49
46
50
47
function getNamedExportDeclaration ( sourceFile : SourceFile ) : ExportDeclaration | undefined {
51
48
let namedExport ;
52
- const statements = sourceFile . statements . filter ( isExportDeclaration ) ;
53
- for ( const statement of statements ) {
54
- if ( statement . exportClause && isNamedExports ( statement . exportClause ) ) {
49
+ for ( const statement of sourceFile . statements ) {
50
+ if ( isExportDeclaration ( statement ) && statement . exportClause &&
51
+ isNamedExports ( statement . exportClause ) ) {
55
52
namedExport = statement ;
56
53
}
57
54
}
@@ -64,8 +61,7 @@ namespace ts.codefix {
64
61
65
62
function sortSpecifiers ( specifiers : ExportSpecifier [ ] ) : readonly ExportSpecifier [ ] {
66
63
return stableSort ( specifiers , ( s1 , s2 ) => {
67
- return compareIdentifiers ( s1 . propertyName || s1 . name , s2 . propertyName || s2 . name ) ||
68
- compareIdentifiers ( s1 . name , s2 . name ) ;
64
+ return compareIdentifiers ( s1 . propertyName || s1 . name , s2 . propertyName || s2 . name ) ;
69
65
} ) ;
70
66
}
71
67
0 commit comments