Skip to content

Commit

Permalink
fix: await required functions & allow to pass this
Browse files Browse the repository at this point in the history
  • Loading branch information
sculpt0r committed Mar 15, 2023
1 parent 7000e15 commit 7fe1622
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/worker/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ const run = async options => {
const loadedModule = await load(path);

if (typeof loadedModule === 'function') {
loadedModule.apply(null, ...options);
await loadedModule.apply(...options);
} else if (typeof loadedModule.default === 'function') {
loadedModule.default.apply(null, ...options);
await loadedModule.default.apply(...options);
} else {
channel.send({type: 'non-invokable-require-option'});
}
Expand Down

0 comments on commit 7fe1622

Please sign in to comment.