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:
authorRebecca Turner <me@re-becca.org>2017-05-10 03:05:12 +0300
committerRebecca Turner <me@re-becca.org>2017-05-26 04:55:08 +0300
commit2d7b23e52193fa7c690a63a15a785a7c61aea206 (patch)
tree67f0bb9d2cedd9a024686fa3c72c510bff072187 /lib
parent8639aa663d98e479a01bc1e75eccc7f03cde894a (diff)
node: Make sure we _really_ only add new keys to the top level
Diffstat (limited to 'lib')
-rw-r--r--lib/install/node.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/install/node.js b/lib/install/node.js
index 305f705ef..b1b01fa8b 100644
--- a/lib/install/node.js
+++ b/lib/install/node.js
@@ -28,17 +28,17 @@ function isLink (node) {
return node && node.isLink
}
-var create = exports.create = function (node, template) {
+var create = exports.create = function (node, template, isNotTop) {
if (!template) template = defaultTemplate
Object.keys(template).forEach(function (key) {
if (template[key] != null && typeof template[key] === 'object' && !(template[key] instanceof Array)) {
if (!node[key]) node[key] = {}
- return create(node[key], template[key])
+ return create(node[key], template[key], true)
}
if (node[key] != null) return
node[key] = template[key]
})
- if (node.package) {
+ if (!isNotTop) {
// isLink is true for the symlink and everything inside it.
// by contrast, isInLink is true for only the things inside a link
if (node.isLink == null && isLink(node.parent)) {