Skip to content

Commit

Permalink
fix: fix #1044 support for typescript processors
Browse files Browse the repository at this point in the history
  • Loading branch information
manast committed Jan 20, 2019
1 parent f12d7ad commit 5c1376d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,10 @@ Queue.prototype.setHandler = function(name, handler) {
this.setWorkerName();

if (typeof handler === 'string') {
const supportedFileTypes = ['js', 'ts', 'flow'];
const processorFile =
handler + (path.extname(handler) === '.js' ? '' : '.js');
handler +
(supportedFileTypes.indexOf(path.extname(handler)) !== '-1' ? '' : '.js');

if (!fs.existsSync(processorFile)) {
throw new Error('File ' + processorFile + ' does not exist');
Expand Down

0 comments on commit 5c1376d

Please sign in to comment.