summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/read-installed/read-installed.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-02-06 08:39:27 -0800
committerisaacs <i@izs.me>2013-02-06 08:39:31 -0800
commit5aef65a98a9427bcd6f41d8f65235bd26883d2d7 (patch)
treef1e290db817cedc3af49d6f6423ca7033cbdee18 /deps/npm/node_modules/read-installed/read-installed.js
parenta86ebbe2885fe6f2b6adeeaa95c8abc12d821d7b (diff)
downloadnode-new-5aef65a98a9427bcd6f41d8f65235bd26883d2d7.tar.gz
npm: Upgrade to v1.2.10
Diffstat (limited to 'deps/npm/node_modules/read-installed/read-installed.js')
-rw-r--r--deps/npm/node_modules/read-installed/read-installed.js21
1 files changed, 17 insertions, 4 deletions
diff --git a/deps/npm/node_modules/read-installed/read-installed.js b/deps/npm/node_modules/read-installed/read-installed.js
index 192907c26c..4babfc862a 100644
--- a/deps/npm/node_modules/read-installed/read-installed.js
+++ b/deps/npm/node_modules/read-installed/read-installed.js
@@ -121,8 +121,6 @@ function readInstalled (folder, depth, cb) {
var rpSeen = {}
function readInstalled_ (folder, parent, name, reqver, depth, maxDepth, cb) {
- //console.error(folder, name)
-
var installed
, obj
, real
@@ -251,6 +249,7 @@ function resolveInheritance (obj) {
Object.keys(obj.dependencies).forEach(function (dep) {
resolveInheritance(obj.dependencies[dep])
})
+ findUnmet(obj)
}
// find unmet deps by walking up the tree object.
@@ -261,6 +260,7 @@ function findUnmet (obj) {
fuSeen.push(obj)
//console.error("find unmet", obj.name, obj.parent && obj.parent.name)
var deps = obj.dependencies = obj.dependencies || {}
+
//console.error(deps)
Object.keys(deps)
.filter(function (d) { return typeof deps[d] === "string" })
@@ -297,8 +297,21 @@ function findUnmet (obj) {
var peerDeps = obj.peerDependencies = obj.peerDependencies || {}
Object.keys(peerDeps).forEach(function (d) {
- var dependency = obj.parent && obj.parent.dependencies &&
- obj.parent.dependencies[d]
+ var dependency
+
+ if (!obj.parent) {
+ dependency = obj.dependencies[d]
+
+ // read it as a missing dep
+ if (!dependency) {
+ obj.dependencies[d] = peerDeps[d]
+ }
+ } else {
+ dependency = obj.parent.dependencies && obj.parent.dependencies[d]
+ }
+
+ if (!dependency) return
+
dependency.extraneous = false
if (!semver.satisfies(dependency.version, peerDeps[d])) {