We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b07797c commit 18f9d69Copy full SHA for 18f9d69
1 file changed
src/services/codefixes/importFixes.ts
@@ -789,9 +789,7 @@ namespace ts.codefix {
789
}
790
791
function getEscapedNameForExportDefault(symbol: Symbol): __String | undefined {
792
- const declarations = symbol.declarations;
793
- if (length(declarations) > 0) {
794
- const declaration = declarations[0];
+ return firstDefined(symbol.declarations, declaration => {
795
if (isExportAssignment(declaration)) {
796
if (isIdentifier(declaration.expression)) {
797
return declaration.expression.escapedText;
@@ -803,7 +801,7 @@ namespace ts.codefix {
803
801
return declaration.propertyName.escapedText;
804
802
805
806
- }
+ });
807
808
});
809
0 commit comments