Skip to content

Commit 18f9d69

Browse files
committed
Stop limiting getEscapedNameForExportDefault to the first declaration
1 parent b07797c commit 18f9d69

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/services/codefixes/importFixes.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -789,9 +789,7 @@ namespace ts.codefix {
789789
}
790790

791791
function getEscapedNameForExportDefault(symbol: Symbol): __String | undefined {
792-
const declarations = symbol.declarations;
793-
if (length(declarations) > 0) {
794-
const declaration = declarations[0];
792+
return firstDefined(symbol.declarations, declaration => {
795793
if (isExportAssignment(declaration)) {
796794
if (isIdentifier(declaration.expression)) {
797795
return declaration.expression.escapedText;
@@ -803,7 +801,7 @@ namespace ts.codefix {
803801
return declaration.propertyName.escapedText;
804802
}
805803
}
806-
}
804+
});
807805
}
808806
});
809807

0 commit comments

Comments
 (0)