diff --git a/lib/extend/deployer.js b/lib/extend/deployer.js index c02b8d0fd3..4653662f08 100644 --- a/lib/extend/deployer.js +++ b/lib/extend/deployer.js @@ -2,29 +2,31 @@ const Promise = require('bluebird'); -function Deployer() { - this.store = {}; -} +class Deployer { + constructor() { + this.store = {}; + } -Deployer.prototype.list = function() { - return this.store; -}; + list() { + return this.store; + } -Deployer.prototype.get = function(name) { - return this.store[name]; -}; + get(name) { + return this.store[name]; + } -Deployer.prototype.register = function(name, fn) { - if (!name) throw new TypeError('name is required'); - if (typeof fn !== 'function') throw new TypeError('fn must be a function'); + register(name, fn) { + if (!name) throw new TypeError('name is required'); + if (typeof fn !== 'function') throw new TypeError('fn must be a function'); - if (fn.length > 1) { - fn = Promise.promisify(fn); - } else { - fn = Promise.method(fn); - } + if (fn.length > 1) { + fn = Promise.promisify(fn); + } else { + fn = Promise.method(fn); + } - this.store[name] = fn; -}; + this.store[name] = fn; + } +} module.exports = Deployer;