diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2014-06-26 04:11:39 +0400 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2014-07-02 05:49:45 +0400 |
commit | 2793877f5b412c200a249f928f81b4d1bc03a35f (patch) | |
tree | d580faf024533cf3098536b543f2b644359d14aa /lib | |
parent | 0c007eefb50baa7dc41b5f13e565595217e64563 (diff) |
opportunistic linting
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cache.js | 4 | ||||
-rw-r--r-- | lib/cache/add-remote-git.js | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/cache.js b/lib/cache.js index 6125adcd1..fd71f38d9 100644 --- a/lib/cache.js +++ b/lib/cache.js @@ -157,7 +157,7 @@ function ls (args, cb) { args = args.join("/").split("@").join("/") if (args.substr(-1) === "/") args = args.substr(0, args.length - 1) var prefix = npm.config.get("cache") - if (0 === prefix.indexOf(process.env.HOME)) { + if (prefix.indexOf(process.env.HOME) === 0) { prefix = "~" + prefix.substr(process.env.HOME.length) } ls_(args, npm.config.get("depth"), function (er, files) { @@ -320,7 +320,7 @@ function afterAdd (cb) { return function (er, data) { var done = inflight(pj, cb) - if (!done) return + if (!done) return undefined fs.writeFile(tmp, JSON.stringify(data), "utf8", function (er) { if (er) return done(er) diff --git a/lib/cache/add-remote-git.js b/lib/cache/add-remote-git.js index ec979f335..da0d1fd2f 100644 --- a/lib/cache/add-remote-git.js +++ b/lib/cache/add-remote-git.js @@ -62,7 +62,7 @@ module.exports = function addRemoteGit (u, silent, cb_) { var co = parsed.hash && parsed.hash.substr(1) || "master" var v = crypto.createHash("sha1").update(u).digest("hex").slice(0, 8) - v = u.replace(/[^a-zA-Z0-9]+/g, '-') + '-' + v + v = u.replace(/[^a-zA-Z0-9]+/g, "-")+"-"+v log.verbose("addRemoteGit", [u, co]) @@ -186,11 +186,11 @@ function archiveGitRemote (p, u, co, origUrl, cb) { // We know that the host won't change, so split and detect this var spo = origUrl.split(parsed.host) var spr = resolved.split(parsed.host) - if (spo[1].charAt(0) === ':' && spr[1].charAt(0) === '/') + if (spo[1].charAt(0) === ":" && spr[1].charAt(0) === "/") spr[1] = spr[1].slice(1) resolved = spr.join(parsed.host) - log.verbose('resolved git url', resolved) + log.verbose("resolved git url", resolved) next() }) } @@ -226,7 +226,7 @@ function gitEnv () { if (gitEnv_) return gitEnv_ gitEnv_ = {} for (var k in process.env) { - if (!~['GIT_PROXY_COMMAND','GIT_SSH','GIT_SSL_NO_VERIFY'].indexOf(k) && k.match(/^GIT/)) continue + if (!~["GIT_PROXY_COMMAND","GIT_SSH","GIT_SSL_NO_VERIFY"].indexOf(k) && k.match(/^GIT/)) continue gitEnv_[k] = process.env[k] } return gitEnv_ |