Skip to content

Commit

Permalink
refactor: Removed ExportAssignmentStructure.isEqualsExport
Browse files Browse the repository at this point in the history
BREAKING CHANGE: ExportAssignmentStructure.isEqualsExport is now isExportEquals. This was incorrectly named.
  • Loading branch information
dsherret committed Apr 22, 2018
1 parent 2b1446a commit 0b098a5
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 9 deletions.
2 changes: 0 additions & 2 deletions src/next-major-deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@

Remove:

* `isEqualsExport` on `ExportAssignmentStructure`.
* `Identifier.getDefinitionReferencingNodes`
* `getRelativePathToSourceFile` and `getRelativePathToSourceFileAsModuleSpecifier`
* `Directory.remove`
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class ExportAssignmentStructurePrinter extends FactoryStructurePrinter<Ex

printText(writer: CodeBlockWriter, structure: ExportAssignmentStructure) {
writer.write("export");
if ((structure.isEqualsExport == null && structure.isExportEquals == null) || structure.isEqualsExport === true || structure.isExportEquals === true)
if (structure.isExportEquals == null || structure.isEqualsExport === true || structure.isExportEquals === true)
writer.write(" = ");
else
writer.write(" default ");
Expand Down
2 changes: 0 additions & 2 deletions src/structures/file/ExportAssignmentStructure.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import CodeBlockWriter from "code-block-writer";

export interface ExportAssignmentStructure {
/** @deprecated - Use isExportEquals. This was incorrectly named. */
isEqualsExport?: boolean;
isExportEquals?: boolean;
expression: string | ((writer: CodeBlockWriter) => void);
}
4 changes: 0 additions & 4 deletions src/tests/compiler/file/sourceFileTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -718,15 +718,11 @@ describe(nameof(SourceFile), () => {
it("should insert the different kinds of exports", () => {
doTest("", 0, [
{ expression: "5" },
{ isEqualsExport: true, expression: writer => writer.write("6") },
{ isExportEquals: true, expression: writer => writer.write("6") },
{ isEqualsExport: false, expression: "name" },
{ isExportEquals: false, expression: "name" }
], [
`export = 5;`,
`export = 6;`,
`export = 6;`,
`export default name;`,
`export default name;`
].join("\n") + "\n");
});
Expand Down

0 comments on commit 0b098a5

Please sign in to comment.