Skip to content

Commit

Permalink
Removed extra spaces, type checking callback when constructed
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan committed Jul 23, 2015
1 parent 39b6eab commit 05e60de
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -5,4 +5,3 @@ node_js:
- "iojs"
before_script: npm run lint
script: ./node_modules/.bin/istanbul cover ./node_modules/.bin/nodeunit test && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf ./coverage

6 changes: 3 additions & 3 deletions lib/schedule.js
Expand Up @@ -25,10 +25,10 @@ function Job(name, job, callback) {
// Make sure callback is actually a callback
if (this.job === name) {
// Name wasn't provided and maybe a callback is there
this.callback = job || false;
this.callback = typeof job === 'function' ? job : false;
} else {
// Name was provided, and maybe a callback is there
this.callback = callback || false;
this.callback = typeof callback === 'function' ? callback : false;
}

// define properties
Expand Down Expand Up @@ -383,7 +383,7 @@ function prepareNextInvocation() {
currentInvocation.timerID = runOnDate(currentInvocation.fireDate, function() {
currentInvocationFinished();

if (job.callback && typeof job.callback === 'function') {
if (job.callback) {
job.callback();
}

Expand Down
1 change: 0 additions & 1 deletion test/convenience-method-test.js
Expand Up @@ -255,7 +255,6 @@ module.exports = {
test.ok(true);
});


setTimeout(function() {
schedule.cancelJob(job.name);
}, 2250);
Expand Down

0 comments on commit 05e60de

Please sign in to comment.