Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2018-03-23 04:23:24 +0300
committerRebecca Turner <me@re-becca.org>2018-03-23 13:46:36 +0300
commit6d1aac42482a5fee7a38310ee2689050f95de056 (patch)
tree2edb3cdab3876945d2c25bdc922bf2a451c5560e /lib/outdated.js
parentc8146858d6e51411650ad4dc3bc5e294068ed1dc (diff)
standardize
Diffstat (limited to 'lib/outdated.js')
-rw-r--r--lib/outdated.js46
1 files changed, 20 insertions, 26 deletions
diff --git a/lib/outdated.js b/lib/outdated.js
index 5cae20043..8b0a43d6b 100644
--- a/lib/outdated.js
+++ b/lib/outdated.js
@@ -89,11 +89,11 @@ function outdated (args, silent, cb) {
} else {
var outList = list.map(makePretty)
var outHead = [ 'Package',
- 'Current',
- 'Wanted',
- 'Latest',
- 'Location'
- ]
+ 'Current',
+ 'Wanted',
+ 'Latest',
+ 'Location'
+ ]
if (long) outHead.push('Package Type')
var outTable = [outHead].concat(outList)
@@ -117,25 +117,19 @@ function outdated (args, silent, cb) {
// [[ dir, dep, has, want, latest, type ]]
function makePretty (p) {
- var dep = p[0]
var depname = p[1]
- var dir = dep.path
var has = p[2]
var want = p[3]
var latest = p[4]
var type = p[6]
var deppath = p[7]
- if (!npm.config.get('global')) {
- dir = path.relative(process.cwd(), dir)
- }
-
var columns = [ depname,
- has || 'MISSING',
- want,
- latest,
- deppath
- ]
+ has || 'MISSING',
+ want,
+ latest,
+ deppath
+ ]
if (long) columns[5] = type
if (npm.color) {
@@ -183,10 +177,10 @@ function makeJSON (list) {
dir = path.relative(process.cwd(), dir)
}
out[depname] = { current: has,
- wanted: want,
- latest: latest,
- location: dir
- }
+ wanted: want,
+ latest: latest,
+ location: dir
+ }
if (long) out[depname].type = type
})
return JSON.stringify(out, null, 2)
@@ -317,11 +311,11 @@ function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, cb, type) {
// show user that no viable version can be found
if (er) return cb(er)
outdated_(args,
- pkgpath,
- tree,
- has,
- depth + 1,
- cb)
+ pkgpath,
+ tree,
+ has,
+ depth + 1,
+ cb)
}
function doIt (wanted, latest) {
@@ -399,7 +393,7 @@ function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, cb, type) {
var cFromUrl = curr && curr.from && url.parse(curr.from).protocol
if (!curr ||
- dFromUrl && cFromUrl && m._from !== curr.from ||
+ (dFromUrl && cFromUrl && m._from !== curr.from) ||
m.version !== curr.version ||
m.version !== l.version) {
doIt(m.version, l.version)