mirror of https://github.com/webpack/webpack.git
fix total item counting
This commit is contained in:
parent
5b797bb55f
commit
f1d23381aa
|
@ -1327,9 +1327,12 @@ const getTotalSize = children => {
|
|||
const getTotalItems = children => {
|
||||
let count = 0;
|
||||
for (const child of children) {
|
||||
if (child.children) count += getTotalItems(child.children);
|
||||
else if (child.filteredChildren) count += child.filteredChildren;
|
||||
else count++;
|
||||
if (!child.children && !child.filteredChildren) {
|
||||
count++;
|
||||
} else {
|
||||
if (child.children) count += getTotalItems(child.children);
|
||||
if (child.filteredChildren) count += child.filteredChildren;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue