Skip to content

Commit

Permalink
Add missing comment back
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Aug 1, 2023
1 parent 56de025 commit 33f7df1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/tree/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ export function getModulePathParts(moduleData) {
const loaders = moduleData.name.split('!');
// Removing loaders from module path: they're joined by `!` and the last part is a raw module path
const parsedPath = loaders[loaders.length - 1]
// Splitting module path into parts
.split('/')
// Removing first `.`
.slice(1)
// Replacing `~` with `node_modules`
.map(part => (part === '~' ? 'node_modules' : part));

return parsedPath.length ? parsedPath : null;
Expand Down
2 changes: 1 addition & 1 deletion src/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function getChartData(analyzerOpts, ...args) {
chartData = null;
}

if (_.isPlainObject(chartData) && Object.keys(chartData) === 0) {
if (_.isPlainObject(chartData) && Object.keys(chartData).length === 0) {
logger.error("Could't find any javascript bundles in provided stats file");
chartData = null;
}
Expand Down

0 comments on commit 33f7df1

Please sign in to comment.