Skip to content

Commit

Permalink
Breaking: Make .tasks return an object instead of array
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Oct 2, 2017
1 parent f55c3d9 commit a16fe50
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Expand Up @@ -13,7 +13,12 @@ DefaultRegistry.prototype.set = function set(name, fn){
};

DefaultRegistry.prototype.tasks = function tasks(){
return Object.keys(this._tasks).map(this.get, this);
var self = this;

return Object.keys(this._tasks).reduce(function(tasks, name){
tasks[name] = self.get(name);
return tasks;
}, {});
};

module.exports = DefaultRegistry;

0 comments on commit a16fe50

Please sign in to comment.