hyperdrive-ui
Advanced tools
Comparing version 4.0.1 to 4.0.2
22
index.js
@@ -10,14 +10,11 @@ var path = require('path') | ||
var root = opts.root || '' | ||
var entries = {} | ||
if (Array.isArray(opts.entries)) { | ||
for (var i in opts.entries) { | ||
addEntry(opts.entries[i]) | ||
} | ||
} | ||
var entries = opts.entries || [] | ||
var uniques = {} | ||
opts.entries.forEach(addEntry) | ||
function addEntry (entry) { | ||
entries[entry.name] = entry | ||
uniques[entry.name] = entry | ||
var dir = path.dirname(entry.name) | ||
if (!entries[dir]) { | ||
entries[dir] = { | ||
if (!uniques[dir]) { | ||
uniques[dir] = { | ||
type: 'directory', | ||
@@ -43,5 +40,5 @@ name: dir, | ||
var vals = [] | ||
for (var key in entries) { | ||
if (entries.hasOwnProperty(key)) { | ||
vals.push(entries[key]) | ||
for (var key in uniques) { | ||
if (uniques.hasOwnProperty(key)) { | ||
vals.push(uniques[key]) | ||
} | ||
@@ -61,3 +58,2 @@ } | ||
addEntry(entry) | ||
update() | ||
@@ -64,0 +60,0 @@ }) |
{ | ||
"name": "hyperdrive-ui", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "Render a hyperdrive in the browser.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3167
53