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 a998c16 commit ad55e63Copy full SHA for ad55e63
lib/internal/worker.js
@@ -103,7 +103,7 @@ class Worker extends EventEmitter {
103
filename = path.resolve(filename);
104
105
const ext = path.extname(filename);
106
- if (!/^\.[cm]?js$/.test(ext)) {
+ if (ext !== '.js' && ext !== '.mjs' && ext !== '.cjs') {
107
throw new ERR_WORKER_UNSUPPORTED_EXTENSION(ext);
108
}
109
0 commit comments