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:
Diffstat (limited to 'node_modules/read-package-tree/rpt.js')
-rw-r--r--node_modules/read-package-tree/rpt.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/node_modules/read-package-tree/rpt.js b/node_modules/read-package-tree/rpt.js
index 43da67c91..acd91bd8c 100644
--- a/node_modules/read-package-tree/rpt.js
+++ b/node_modules/read-package-tree/rpt.js
@@ -33,7 +33,6 @@ function Node (pkg, logical, physical, er, cache) {
this.id = ID++
this.package = pkg || {}
- if (!this.package.name) this.package.name = path.basename(logical)
this.path = logical
this.realpath = physical
this.parent = null
@@ -63,7 +62,6 @@ function Link (pkg, logical, physical, realpath, er, cache) {
this.path = logical
this.realpath = realpath
this.package = pkg || {}
- if (!this.package.name) this.package.name = path.basename(logical)
this.parent = null
this.target = new Node(this.package, logical, realpath, er, cache)
this.isLink = true
@@ -134,8 +132,8 @@ function loadChildren (node, cache, filterWith, cb) {
function sortChildren (node) {
node.children = node.children.sort(function (a, b) {
- a = a.package.name.toLowerCase()
- b = b.package.name.toLowerCase()
+ a = a.package.name ? a.package.name.toLowerCase() : a.path
+ b = b.package.name ? b.package.name.toLowerCase() : b.path
return a > b ? 1 : -1
})
}