From 2fd2d6bb0e6508ed12cd49d162bfc6fdaa50600e Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Mon, 4 Oct 2021 08:04:09 +0200 Subject: [PATCH] chore: add default export So that we can use `import Emitter from ...` in both CommonJS and ESM modules. --- index.d.ts | 2 +- index.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 0e00dd3..5cae626 100644 --- a/index.d.ts +++ b/index.d.ts @@ -15,4 +15,4 @@ declare const Emitter: { new (obj?: object): Emitter; }; -export = Emitter; +export default Emitter; diff --git a/index.js b/index.js index 6d7ed0a..6c1dfc0 100644 --- a/index.js +++ b/index.js @@ -17,6 +17,9 @@ function Emitter(obj) { if (obj) return mixin(obj); }; +// allow default import +Emitter.default = Emitter; + /** * Mixin the emitter properties. *