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-05-21 02:47:40 +0400
committerisaacs <i@izs.me>2011-05-21 02:47:40 +0400
commitec2b76e4aa154c1c0ed10dec7d7dacb6c069dc31 (patch)
treead09cf3d90907cb9a2fafc81b8cf22b06161cfb5 /lib/utils/read-json.js
parent7629aee06599490434e90e6d2cbaf304c03af86a (diff)
formally deprecate 'modules' json item
Diffstat (limited to 'lib/utils/read-json.js')
-rw-r--r--lib/utils/read-json.js19
1 files changed, 4 insertions, 15 deletions
diff --git a/lib/utils/read-json.js b/lib/utils/read-json.js
index 6d4b73ac7..aa3b93003 100644
--- a/lib/utils/read-json.js
+++ b/lib/utils/read-json.js
@@ -179,7 +179,7 @@ function processObject (opts, cb) { return function (er, json) {
// uncomment once this is no longer an issue.
// if (cb) return cb(e)
// throw e
- log.error(msg, "incorrect json")
+ log.error(msg, "incorrect json: "+json.name)
json.repostory = json.repositories[0]
delete json.repositories
}
@@ -219,19 +219,9 @@ function processObject (opts, cb) { return function (er, json) {
if (tag) json.version = tag//+"-"+json.version
if (json.modules) {
- if (typeof json.modules !== "object") {
- var e = new Error("Invalid modules object")
- if (cb) return cb(e)
- throw e
- }
- Object.keys(json.modules).forEach(function (mod) {
- if (typeof json.modules[mod] !== "string") {
- var e = new Error("Invalid module "+mod+", not a string: "
- +JSON.stringify(json.modules[mod]))
- if (cb) return cb(e)
- throw e
- }
- })
+ var e = new Error("modules object is deprecated")
+ log.error(e, "incorrect json: "+json.name)
+ delete json.modules
}
var scripts = json.scripts || {}
@@ -288,7 +278,6 @@ function processObject (opts, cb) { return function (er, json) {
})
}
-
json._id = json.name+"@"+json.version
json = testEngine(json)
json = parsePeople(unParsePeople(json))