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 => {
|
const getTotalItems = children => {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
for (const child of children) {
|
for (const child of children) {
|
||||||
if (child.children) count += getTotalItems(child.children);
|
if (!child.children && !child.filteredChildren) {
|
||||||
else if (child.filteredChildren) count += child.filteredChildren;
|
count++;
|
||||||
else count++;
|
} else {
|
||||||
|
if (child.children) count += getTotalItems(child.children);
|
||||||
|
if (child.filteredChildren) count += child.filteredChildren;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue