bundle-analyzer
Advanced tools
Comparing version 0.0.5 to 0.0.6
{ | ||
"name": "bundle-analyzer", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"repository": "lhorie/bundle-analyzer", | ||
@@ -5,0 +5,0 @@ "bin": { |
11
sizes.js
@@ -10,3 +10,3 @@ const util = require('util'); | ||
module.exports = async function(dir) { | ||
const paths = await readDir(dir); | ||
const paths = await readDir(dir).catch(() => []); | ||
return (await Promise.all([ | ||
@@ -17,3 +17,5 @@ ...paths.map(async p => { | ||
name: p, | ||
children: normalize(groupByHierarchy(await getSizesByFile(dir, p))), | ||
children: normalize( | ||
groupByHierarchy(await getSizesByFile(dir, p).catch(() => [])) | ||
), | ||
}; | ||
@@ -78,4 +80,5 @@ } | ||
const keys = Object.keys(groups); | ||
if (keys.length === 1) groups = groups[keys[0]]; | ||
else break; | ||
if (keys.length === 1 && typeof groups[keys[0]] !== 'number') { | ||
groups = groups[keys[0]]; | ||
} else break; | ||
} | ||
@@ -82,0 +85,0 @@ return groups; |
Sorry, the diff of this file is not supported yet
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
35813
134