Skip to content

Commit

Permalink
worker: unroll file extension regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Feb 13, 2020
1 parent 611a158 commit 67fa46a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class Worker extends EventEmitter {
filename = path.resolve(filename);

const ext = path.extname(filename);
if (!/^\.[cm]?js$/.test(ext)) {
if (ext !== '.js' && ext !== '.mjs' && ext !== '.cjs') {
throw new ERR_WORKER_UNSUPPORTED_EXTENSION(ext);
}
}
Expand Down

0 comments on commit 67fa46a

Please sign in to comment.