quick jsstyle cleanup

This commit is contained in:
Dave Eddy 2015-09-01 15:03:52 -04:00
parent 0d53e878e9
commit ae8a19d568
5 changed files with 9 additions and 8 deletions

View File

@ -203,7 +203,7 @@ CloudAPI.prototype._path = function _path(subpath /*, qparams, ... */) {
*/
CloudAPI.prototype._request = function _request(options, callback) {
var self = this;
if (typeof options === 'string')
if (typeof (options) === 'string')
options = {path: options};
assert.object(options, 'options');
assert.func(callback, 'callback');

View File

@ -37,7 +37,7 @@ function loadConfigSync(opts) {
c = fs.readFileSync(opts.configPath, 'utf8');
var _user = JSON.parse(c);
var userConfig = JSON.parse(c);
if (typeof(userConfig) !== 'object' || Array.isArray(userConfig)) {
if (typeof (userConfig) !== 'object' || Array.isArray(userConfig)) {
throw new errors.ConfigError(
format('"%s" is not an object', opts.configPath));
}

View File

@ -56,7 +56,7 @@ function do_packages (subcmd, opts, args, callback) {
* on a possible "foo-" prefix.
*/
pkg._groupPlus = (pkg.group || (pkg.name.indexOf('-') === -1
? "" : pkg.name.split('-', 1)[0]));
? '' : pkg.name.split('-', 1)[0]));
if (!opts.p) {
pkg.memoryHuman = common.humanSizeFromBytes({

View File

@ -57,11 +57,11 @@ function do_wait_instance(subcmd, opts, args, cb) {
if (idsToWaitFor.length === 1) {
var inst2 = instFromId[idsToWaitFor[0]];
console.log(
"Waiting for instance %s (%s) to enter state (states: %s)",
'Waiting for instance %s (%s) to enter state (states: %s)',
inst2.name, inst2.id, states.join(', '));
} else {
console.log(
"Waiting for %d instances to enter state (states: %s)",
'Waiting for %d instances to enter state (states: %s)',
idsToWaitFor.length, states.join(', '));
}

View File

@ -142,7 +142,8 @@ Triton.prototype.listImages = function listImages(opts, cb) {
if (opts.useCache) {
fs.readFile(cacheFile, 'utf8', function (err, out) {
if (err) {
self.log.info({err: err}, 'failed to read cache file %s', cacheFile);
self.log.info({err: err}, 'failed to read cache file %s',
cacheFile);
fetch();
return;
}