diff --git a/lib/compiler.js b/lib/compiler.js index e2dea15..c148da2 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -7,7 +7,6 @@ var ConfigLoader = require('./config-loader'); var debug = require('debug')('loopback:boot:compiler'); var Module = require('module'); var _ = require('lodash'); -var _s = require('underscore.string'); var FILE_EXTENSION_JSON = '.json'; @@ -384,7 +383,7 @@ function tryResolveAppPath(rootDir, relativePath, resolveOptions) { function loadModelDefinition(rootDir, jsonFile, allFiles) { var definition = require(jsonFile); var basename = path.basename(jsonFile, path.extname(jsonFile)); - definition.name = definition.name || _s.capitalize(_s.camelize(basename)); + definition.name = definition.name || _.capitalize(_.camelCase(basename)); // find a matching file with a supported extension like `.js` or `.coffee` var sourceFile = fixFileExtension(jsonFile, allFiles, true); diff --git a/lib/executor.js b/lib/executor.js index 43b2fca..609579d 100644 --- a/lib/executor.js +++ b/lib/executor.js @@ -1,5 +1,4 @@ var assert = require('assert'); -var _ = require('lodash'); var semver = require('semver'); var debug = require('debug')('loopback:boot:executor'); var async = require('async'); @@ -107,7 +106,7 @@ function setHost(app, instructions) { function setPort(app, instructions) { // jscs:disable requireCamelCaseOrUpperCaseIdentifiers - var port = _.find([ + var port = find([ process.env.npm_config_port, process.env.OPENSHIFT_SLS_PORT, process.env.OPENSHIFT_NODEJS_PORT, @@ -116,7 +115,9 @@ function setPort(app, instructions) { process.env.npm_package_config_port, app.get('port'), 3000 - ], _.isFinite); + ], function isNumberLike(v) { + return Number.isFinite(parseInt(v, 10)); + }); if (port !== undefined) { var portType = typeof port; @@ -126,6 +127,10 @@ function setPort(app, instructions) { } } +function find(array, predicate) { + return array.filter(predicate)[0]; +} + function setApiRoot(app, instructions) { var restApiRoot = instructions.config.restApiRoot || diff --git a/package.json b/package.json index c2df7b5..0f5c4eb 100644 --- a/package.json +++ b/package.json @@ -26,10 +26,9 @@ "async": "~0.9.0", "commondir": "0.0.1", "debug": "^2.0.0", - "lodash": "^2.4.1", + "lodash": "^3.6.0", "semver": "^4.1.0", - "toposort": "^0.2.10", - "underscore.string": "^3.0.3" + "toposort": "^0.2.10" }, "devDependencies": { "browserify": "^4.1.8",