Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
worker: unroll file extension regexp
  • Loading branch information
addaleax committed Feb 13, 2020
commit 67fa46af0dacf4ecd96d6775a474c2ed04b05fea
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