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 Mar 17, 2020
1 parent 7eb9770 commit bd2ddc1
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 @@ -103,7 +103,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 bd2ddc1

Please sign in to comment.