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:
authorisaacs <i@izs.me>2011-06-16 04:02:22 +0400
committerisaacs <i@izs.me>2011-06-16 04:02:22 +0400
commit06dd026d04768edd7adf2aa37cf9a8d9e8c335be (patch)
tree6f65419764b21a1978ac8110beaa10d2fe8b8c50
parent5a3bbd287b3ab68877a6c058d8fd205629e42aac (diff)
capture json opts when json is parsed
-rw-r--r--lib/utils/read-json.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/utils/read-json.js b/lib/utils/read-json.js
index 200a017ca..a4a445f2a 100644
--- a/lib/utils/read-json.js
+++ b/lib/utils/read-json.js
@@ -143,6 +143,8 @@ function jsonParseFail (ex, file, cb) {
var modulesWarned = {}
function processObject (opts, cb) { return function (er, json) {
+ json._npmJsonOpts = opts
+ // log.warn(json, "processing json")
// slashes would be a security risk.
// anything else will just fail harmlessly.
@@ -268,7 +270,7 @@ function processObject (opts, cb) { return function (er, json) {
if (json["dev-dependencies"] && !json.devDependencies) {
json.devDependencies = json["dev-dependencies"]
- delete json["dev-dependencies"]
+ json["dev-dependencies"] = null
}
;["dependencies", "devDependencies"].forEach(function (d) {
@@ -276,9 +278,11 @@ function processObject (opts, cb) { return function (er, json) {
})
if (opts.dev || npm.config.get("dev") || npm.config.get("npat")) {
+ // log.warn(json._id, "Adding devdeps")
Object.keys(json.devDependencies || {}).forEach(function (d) {
json.dependencies[d] = json.devDependencies[d]
})
+ // log.warn(json.dependencies, "Added devdeps")
}
json = testEngine(json)