Skip to content

Commit

Permalink
chore: add default export
Browse files Browse the repository at this point in the history
So that we can use `import Emitter from ...` in both CommonJS and ESM
modules.
  • Loading branch information
darrachequesne committed Oct 4, 2021
1 parent 908fbc4 commit 2fd2d6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ declare const Emitter: {
new (obj?: object): Emitter;
};

export = Emitter;
export default Emitter;
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ function Emitter(obj) {
if (obj) return mixin(obj);
};

// allow default import
Emitter.default = Emitter;

/**
* Mixin the emitter properties.
*
Expand Down

0 comments on commit 2fd2d6b

Please sign in to comment.