Skip to content

Commit

Permalink
Wrap conditional require in try-catch for esbuild
Browse files Browse the repository at this point in the history
fixes #42
closes #43
  • Loading branch information
r-token authored and dougwilson committed Sep 29, 2022
1 parent a9dbe17 commit 8feb5ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
unreleased
==========

* Wrap conditional require in try-catch for esbuild
* perf: enable strict mode
* perf: remove overhead when no end callback

Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ try {
var EventEmitter = require('events').EventEmitter;
if (!EventEmitter) throw new Error();
} catch (err) {
var Emitter = require('emitter');
try {
var Emitter = require('emitter')
} catch (err) {
throw err
}
}

/**
Expand Down

0 comments on commit 8feb5ff

Please sign in to comment.