MCPcopy
hub / github.com/webpack/webpack / getTotalItems

Function getTotalItems

lib/stats/DefaultStatsFactoryPlugin.js:1839–1850  ·  view source on GitHub ↗
(children)

Source from the content-addressed store, hash-verified

1837 * @returns {number} total items
1838 */
1839const getTotalItems = (children) => {
1840 let count = 0;
1841 for (const child of children) {
1842 if (!child.children && !child.filteredChildren) {
1843 count++;
1844 } else {
1845 if (child.children) count += getTotalItems(child.children);
1846 if (child.filteredChildren) count += child.filteredChildren;
1847 }
1848 }
1849 return count;
1850};
1851
1852/**
1853 * Returns collapsed children.

Callers 2

collapseFunction · 0.85
spaceLimitedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected