diff --git a/lib/cylon.js b/lib/cylon.js index 7998e3b..4757fc0 100644 --- a/lib/cylon.js +++ b/lib/cylon.js @@ -88,26 +88,16 @@ Cylon.api = function api(Server, opts) { try { Server = require(req); } catch (e) { - if (e.code === "MODULE_NOT_FOUND") { - var messages; - - if (req === "cylon-api-http") { - messages = [ - "The HTTP API is no longer included in Cylon by default.", - "To use it, install the plugin module: `npm install cylon-api-http`" - ]; - } else { - messages = [ - "Cannot find the " + req + " API module.", - "You may be able to install it: `npm install " + req + "`" - ]; - } - - _.each(messages, _.arity(Logger.fatal, 1)); - throw new Error("Missing API plugin - cannot proceed"); - } else { + if (e.code !== "MODULE_NOT_FOUND") { throw e; } + + [ + "Cannot find the " + req + " API module.", + "You may be able to install it: `npm install " + req + "`" + ].forEach(_.arity(Logger.fatal, 1)); + + throw new Error("Missing API plugin - cannot proceed"); } } diff --git a/lib/driver.js b/lib/driver.js index d2735dd..fa4be6f 100644 --- a/lib/driver.js +++ b/lib/driver.js @@ -6,8 +6,6 @@ * Licensed under the Apache 2.0 license. */ -/* eslint camelcase: 0 */ - "use strict"; var Basestar = require("./basestar"), @@ -85,7 +83,7 @@ Driver.prototype.setupCommands = function(commands, proxy) { Utils.proxyFunctionsToObject(commands, proxy, this); commands.forEach(function(command) { - var snake_case = command.replace(/[A-Z]+/g, function(match) { + var snakeCase = command.replace(/[A-Z]+/g, function(match) { if (match.length > 1) { match = match.replace(/[A-Z]$/, function(m) { return "_" + m.toLowerCase(); @@ -95,7 +93,7 @@ Driver.prototype.setupCommands = function(commands, proxy) { return "_" + match.toLowerCase(); }).replace(/^_/, ""); - this.commands[snake_case] = this[command]; + this.commands[snakeCase] = this[command]; }, this); };