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 7eb9770 commit bd2ddc1Copy full SHA for bd2ddc1
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