diff options
author | Evan You <yyou@google.com> | 2014-05-14 21:05:14 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2014-05-23 05:02:44 +0400 |
commit | 05bf3a765b471c9ad3898a51498b10d6c10b250e (patch) | |
tree | 26f4b8c910f5936e3337b8ebd162791e86829a0a /lib | |
parent | 0c123255398d6e2c9a072e5dba429b826c65ebf9 (diff) |
fix `npm ls` labeling issue
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ls.js | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -128,8 +128,7 @@ function getLite (data, noname) { var dep = data.dependencies[d] if (typeof dep === "string") { lite.problems = lite.problems || [] - var p - if (data.depth >= maxDepth) { + if (data.depth > maxDepth) { p = "max depth reached: " } else { p = "missing: " @@ -223,14 +222,14 @@ function makeArchy (data, long, dir) { function makeArchy_ (data, long, dir, depth, parent, d) { var color = npm.color if (typeof data === "string") { - if (depth < npm.config.get("depth")) { + if (depth -1 <= npm.config.get("depth")) { // just missing var p = parent.link || parent.path var unmet = "UNMET DEPENDENCY" if (color) { unmet = "\033[31;40m" + unmet + "\033[0m" } - data = unmet + " " + d + " " + data + data = unmet + " " + d + "@" + data } else { data = d+"@"+ data } |