Skip to content

Commit

Permalink
fix: empty .d.ts files are now valid TS modules
Browse files Browse the repository at this point in the history
  • Loading branch information
tgelu-db committed Jul 21, 2021
1 parent f6cf705 commit df1b902
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dts-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class DtsContent {
}

public get formatted(): string {
if (!this.resultList || !this.resultList.length) return '';
if (!this.resultList || !this.resultList.length) return 'export {};';

if (this.namedExports) {
return (
Expand Down
2 changes: 1 addition & 1 deletion test/dts-creator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export const myClass: string;

it('returns empty object exportion when the result list has no items', done => {
new DtsCreator().create('test/empty.css').then(content => {
assert.equal(content.formatted, '');
assert.equal(content.formatted, 'export {};');
done();
});
});
Expand Down

0 comments on commit df1b902

Please sign in to comment.