summaryrefslogtreecommitdiff
path: root/deps/npm/lib/install/flatten-tree.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/install/flatten-tree.js')
-rw-r--r--deps/npm/lib/install/flatten-tree.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/deps/npm/lib/install/flatten-tree.js b/deps/npm/lib/install/flatten-tree.js
index b6ceb30f2f..56282b771d 100644
--- a/deps/npm/lib/install/flatten-tree.js
+++ b/deps/npm/lib/install/flatten-tree.js
@@ -8,19 +8,19 @@ module.exports.flatNameFromTree = flatNameFromTree
function flattenTree (tree) {
validate('O', arguments)
- var seen = {}
+ var seen = new Set()
var flat = {}
var todo = [[tree, '/']]
while (todo.length) {
var next = todo.shift()
var pkg = next[0]
- seen[pkg.path] = true
+ seen.add(pkg)
var path = next[1]
flat[path] = pkg
if (path !== '/') path += '/'
for (var ii = 0; ii < pkg.children.length; ++ii) {
var child = pkg.children[ii]
- if (!seen[child.path]) {
+ if (!seen.has(child)) {
todo.push([child, flatName(path, child)])
}
}