Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
vankop committed Dec 2, 2021
1 parent 1a50448 commit eae11dd
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/stats/DefaultStatsFactoryPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,11 @@ const collapse = children => {
return newChildren;
};

const spaceLimited = (itemsAndGroups, max, innerSpace = false) => {
const spaceLimited = (
itemsAndGroups,
max,
filteredChildrenLineReserved = false
) => {
if (max < 1) {
return {
children: undefined,
Expand Down Expand Up @@ -1697,12 +1701,14 @@ const spaceLimited = (itemsAndGroups, max, innerSpace = false) => {
} else if (groups.length === 0) {
// slice items to max
// inner space marks that lines for filteredChildren already reserved
const limit = max - (innerSpace ? 0 : 1);
const limit = max - (filteredChildrenLineReserved ? 0 : 1);
filteredChildren = items.length - limit;
items.length = limit;
children = items;
} else {
const limit = groups.length + (innerSpace ? 0 : Math.min(1, items.length));
const limit =
groups.length +
(filteredChildrenLineReserved ? 0 : Math.min(1, items.length));
if (limit < max) {
// calculate how much we are over the size limit
// this allows to approach the limit faster
Expand All @@ -1713,7 +1719,7 @@ const spaceLimited = (itemsAndGroups, max, innerSpace = false) => {
(oversize =
groupsSize +
items.length +
(filteredChildren && !innerSpace ? 1 : 0) -
(filteredChildren && !filteredChildrenLineReserved ? 1 : 0) -
max) > 0
) {
// Find the maximum group and process only this one
Expand All @@ -1737,7 +1743,7 @@ const spaceLimited = (itemsAndGroups, max, innerSpace = false) => {
Math.ceil(oversize / groups.length) -
// we substitute size of group head
headerSize,
true
headerSize === 2
);
groups[i] = {
...group,
Expand Down

0 comments on commit eae11dd

Please sign in to comment.