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
path: root/lib
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-04-01 01:49:57 +0400
committerisaacs <i@izs.me>2011-04-01 01:49:57 +0400
commit85ae2009de484ac1ddf859382d9d9ddca112c030 (patch)
tree57d4f6031a926277be6f1a0f76e4279fd83d0932 /lib
parent5dd4ec0b50bd6fe9b758582a9956188a1e80682b (diff)
create dependency object if missing
Diffstat (limited to 'lib')
-rw-r--r--lib/utils/read-json.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/utils/read-json.js b/lib/utils/read-json.js
index 493aa0345..55abfe002 100644
--- a/lib/utils/read-json.js
+++ b/lib/utils/read-json.js
@@ -216,8 +216,7 @@ function processObject (opts, cb) { return function (er, json) {
delete json["dev-dependencies"]
}
;["dependencies", "devDependencies"].forEach(function (d) {
- if (!json[d]) return
- json[d] = depObjectify(json[d])
+ json[d] = json[d] ? depObjectify(json[d]) : {}
})
if (npm.config.get("dev") || npm.config.get("npat")) {
Object.keys(json.devDependencies || {}).forEach(function (d) {