diff options
author | Rebecca Turner <me@re-becca.org> | 2015-06-04 11:37:03 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-06-26 03:27:06 +0300 |
commit | 289028fa8abed8bd763f9632c13bcc07f3749f59 (patch) | |
tree | 3aaef8a20c5573e70cf98ff71352454b844db98b /lib/install.js | |
parent | ca41e4a2e740052dec3869348851c60d40090d0a (diff) |
Refactor debugTree to be clearer / more consistent
Diffstat (limited to 'lib/install.js')
-rw-r--r-- | lib/install.js | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/install.js b/lib/install.js index 028b93afc..d2790a429 100644 --- a/lib/install.js +++ b/lib/install.js @@ -532,14 +532,11 @@ Installer.prototype.prettify = function (tree) { function byName (aa, bb) { return aa.package.name.localeCompare(bb.package.name) } - return archy({ - label: tree.package.name + '@' + tree.package.version + - ' ' + tree.path, - nodes: (tree.children || []).sort(byName).map(function expandChild (child) { - return { - label: child.package.name + '@' + child.package.version, - nodes: child.children.sort(byName).map(expandChild) - } - }) - }, '', { unicode: npm.config.get('unicode') }) + function expandTree (tree) { + return { + label: tree.package.name + '@' + tree.package.version, + nodes: tree.children.sort(byName).map(expandTree) + } + } + return archy(expandTree(tree), '', { unicode: npm.config.get('unicode') }) } |