Skip to content

Commit

Permalink
Improve compatibility with Bun (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
vveisard committed Mar 2, 2024
1 parent 95f2823 commit 15f4734
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import pTimeout from 'p-timeout';

const normalizeEmitter = emitter => {
const addListener = emitter.on || emitter.addListener || emitter.addEventListener;
const removeListener = emitter.off || emitter.removeListener || emitter.removeEventListener;
const addListener = emitter.addEventListener || emitter.on || emitter.addListener;
const removeListener = emitter.removeEventListener || emitter.off || emitter.removeListener;

if (!addListener || !removeListener) {
throw new TypeError('Emitter is not compatible');
Expand Down

0 comments on commit 15f4734

Please sign in to comment.