Skip to content

Commit

Permalink
worker: unroll file extension regexp
Browse files Browse the repository at this point in the history
Refs: #31662 (comment)

PR-URL: #31779
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Denys Otrishko <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
addaleax authored and codebytere committed Feb 27, 2020
1 parent eb2dce8 commit f87ac90
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 f87ac90

Please sign in to comment.