We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb2dce8 commit f87ac90Copy full SHA for f87ac90
lib/internal/worker.js
@@ -104,7 +104,7 @@ class Worker extends EventEmitter {
104
filename = path.resolve(filename);
105
106
const ext = path.extname(filename);
107
- if (!/^\.[cm]?js$/.test(ext)) {
+ if (ext !== '.js' && ext !== '.mjs' && ext !== '.cjs') {
108
throw new ERR_WORKER_UNSUPPORTED_EXTENSION(ext);
109
}
110
0 commit comments