Skip to content

Commit

Permalink
Merge pull request #142 from tgelu/fix/78-empty-ts-files
Browse files Browse the repository at this point in the history
#78 fix: empty .d.ts files are now valid TS modules
  • Loading branch information
Quramy committed Oct 12, 2023
2 parents 08a26a7 + df1b902 commit 19a1d9d
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 @@ -63,7 +63,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 @@ -185,7 +185,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 19a1d9d

Please sign in to comment.