diff options
author | Rebecca Turner <me@re-becca.org> | 2017-06-27 03:30:29 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2017-06-27 03:30:29 +0300 |
commit | 3e511928d439d72b483f98d1afcc5e8b9cef4bd3 (patch) | |
tree | b5b6f6b7f95dfb82fb43124a403bd325a461b490 /node_modules | |
parent | d0f3b5a127718b0347c6622a2b9c28341c530d36 (diff) |
read-package-json@2.0.8
Diffstat (limited to 'node_modules')
-rw-r--r-- | node_modules/read-package-json/package.json | 20 | ||||
-rw-r--r-- | node_modules/read-package-json/read-json.js | 22 |
2 files changed, 30 insertions, 12 deletions
diff --git a/node_modules/read-package-json/package.json b/node_modules/read-package-json/package.json index dd78f7c08..fb4455531 100644 --- a/node_modules/read-package-json/package.json +++ b/node_modules/read-package-json/package.json @@ -1,19 +1,19 @@ { - "_from": "read-package-json@2.0.7", - "_id": "read-package-json@2.0.7", + "_from": "read-package-json@2.0.8", + "_id": "read-package-json@2.0.8", "_inBundle": false, - "_integrity": "sha512-0rbvaY14ox+gjOpyaOB28iIbqCKephWiKv0HBOIExYCiuKm7PXLUk3gFN0xl/ZnRYC7Nd2D96KtO3kFtve9XFQ==", + "_integrity": "sha512-w85XtKsha0Fpm+1WRBNWiPxW6EzzcWh33evYsVPNimIUVspBR6wqzWqr3U0DHFPfO5SijcSYL5ZRe3hsCOlRlw==", "_location": "/read-package-json", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "read-package-json@2.0.7", + "raw": "read-package-json@2.0.8", "name": "read-package-json", "escapedName": "read-package-json", - "rawSpec": "2.0.7", + "rawSpec": "2.0.8", "saveSpec": null, - "fetchSpec": "2.0.7" + "fetchSpec": "2.0.8" }, "_requiredBy": [ "#USER", @@ -22,9 +22,9 @@ "/read-installed", "/read-package-tree" ], - "_resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.7.tgz", - "_shasum": "c79ed6059753dafdd21b150f864735b274ac2c2d", - "_spec": "read-package-json@2.0.7", + "_resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.8.tgz", + "_shasum": "3e9938660d57447054bbc0a4bced8c3016d1447b", + "_spec": "read-package-json@2.0.8", "_where": "/Users/rebecca/code/npm", "author": { "name": "Isaac Z. Schlueter", @@ -64,5 +64,5 @@ "scripts": { "test": "standard && tap -J test/*.js" }, - "version": "2.0.7" + "version": "2.0.8" } diff --git a/node_modules/read-package-json/read-json.js b/node_modules/read-package-json/read-json.js index 70ddb09b3..926243b3a 100644 --- a/node_modules/read-package-json/read-json.js +++ b/node_modules/read-package-json/read-json.js @@ -59,6 +59,24 @@ function stripBOM (content) { return content } +function jsonClone (obj) { + if (obj == null) { + return obj + } else if (typeof obj === 'object') { + var newobj = {} + for (var kk in obj) { + newobj[kk] = jsonClone[kk] + } + } else if (typeof obj === 'array') { + var newarr = new Array(obj.length) + for (var ii in obj) { + newarr[ii] = obj[ii] + } + } else { + return obj + } +} + function parseJson (file, er, d, log, strict, cb) { if (er && er.code === 'ENOENT') { return fs.stat(path.dirname(file), function (err, stat) { @@ -74,7 +92,7 @@ function parseJson (file, er, d, log, strict, cb) { } if (er) return cb(er) - if (cache[d]) return cb(null, cache[d]) + if (cache[d]) return cb(null, jsonClone(cache[d])) var data @@ -91,7 +109,7 @@ function parseJson (file, er, d, log, strict, cb) { function extrasCached (file, d, data, log, strict, cb) { extras(file, data, log, strict, (err, data) => { if (!err) { - cache[d] = data + cache[d] = jsonClone(data) } cb(err, data) }) |