mol_dump_lib 0.0.649 → 0.0.651

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/node.mjs CHANGED
@@ -4607,7 +4607,7 @@ var $;
4607
4607
  min = 0;
4608
4608
  top = Math.ceil(rect?.top ?? 0);
4609
4609
  while (min < (kids.length - 1)) {
4610
- const height = kids[min].minimal_height();
4610
+ const height = kids[min]?.minimal_height() ?? 0;
4611
4611
  if (top + height >= limit_top)
4612
4612
  break;
4613
4613
  top += height;
@@ -4629,21 +4629,21 @@ var $;
4629
4629
  }
4630
4630
  while (anchoring && ((top2 > limit_top) && (min2 > 0))) {
4631
4631
  --min2;
4632
- top2 -= kids[min2].minimal_height();
4632
+ top2 -= kids[min2]?.minimal_height() ?? 0;
4633
4633
  }
4634
4634
  while (bottom2 < limit_bottom && max2 < kids.length) {
4635
- bottom2 += kids[max2].minimal_height();
4635
+ bottom2 += kids[max2]?.minimal_height() ?? 0;
4636
4636
  ++max2;
4637
4637
  }
4638
4638
  return [min2, max2];
4639
4639
  }
4640
4640
  gap_before() {
4641
4641
  const skipped = this.sub().slice(0, this.view_window()[0]);
4642
- return Math.max(0, skipped.reduce((sum, view) => sum + view.minimal_height(), 0));
4642
+ return Math.max(0, skipped.reduce((sum, view) => sum + (view?.minimal_height() ?? 0), 0));
4643
4643
  }
4644
4644
  gap_after() {
4645
4645
  const skipped = this.sub().slice(this.view_window()[1]);
4646
- return Math.max(0, skipped.reduce((sum, view) => sum + view.minimal_height(), 0));
4646
+ return Math.max(0, skipped.reduce((sum, view) => sum + (view?.minimal_height() ?? 0), 0));
4647
4647
  }
4648
4648
  sub_visible() {
4649
4649
  return [
@@ -4655,7 +4655,7 @@ var $;
4655
4655
  minimal_height() {
4656
4656
  return this.sub().reduce((sum, view) => {
4657
4657
  try {
4658
- return sum + view.minimal_height();
4658
+ return sum + (view?.minimal_height() ?? 0);
4659
4659
  }
4660
4660
  catch (error) {
4661
4661
  $mol_fail_log(error);
package/node.test.js CHANGED
@@ -4598,7 +4598,7 @@ var $;
4598
4598
  min = 0;
4599
4599
  top = Math.ceil(rect?.top ?? 0);
4600
4600
  while (min < (kids.length - 1)) {
4601
- const height = kids[min].minimal_height();
4601
+ const height = kids[min]?.minimal_height() ?? 0;
4602
4602
  if (top + height >= limit_top)
4603
4603
  break;
4604
4604
  top += height;
@@ -4620,21 +4620,21 @@ var $;
4620
4620
  }
4621
4621
  while (anchoring && ((top2 > limit_top) && (min2 > 0))) {
4622
4622
  --min2;
4623
- top2 -= kids[min2].minimal_height();
4623
+ top2 -= kids[min2]?.minimal_height() ?? 0;
4624
4624
  }
4625
4625
  while (bottom2 < limit_bottom && max2 < kids.length) {
4626
- bottom2 += kids[max2].minimal_height();
4626
+ bottom2 += kids[max2]?.minimal_height() ?? 0;
4627
4627
  ++max2;
4628
4628
  }
4629
4629
  return [min2, max2];
4630
4630
  }
4631
4631
  gap_before() {
4632
4632
  const skipped = this.sub().slice(0, this.view_window()[0]);
4633
- return Math.max(0, skipped.reduce((sum, view) => sum + view.minimal_height(), 0));
4633
+ return Math.max(0, skipped.reduce((sum, view) => sum + (view?.minimal_height() ?? 0), 0));
4634
4634
  }
4635
4635
  gap_after() {
4636
4636
  const skipped = this.sub().slice(this.view_window()[1]);
4637
- return Math.max(0, skipped.reduce((sum, view) => sum + view.minimal_height(), 0));
4637
+ return Math.max(0, skipped.reduce((sum, view) => sum + (view?.minimal_height() ?? 0), 0));
4638
4638
  }
4639
4639
  sub_visible() {
4640
4640
  return [
@@ -4646,7 +4646,7 @@ var $;
4646
4646
  minimal_height() {
4647
4647
  return this.sub().reduce((sum, view) => {
4648
4648
  try {
4649
- return sum + view.minimal_height();
4649
+ return sum + (view?.minimal_height() ?? 0);
4650
4650
  }
4651
4651
  catch (error) {
4652
4652
  $mol_fail_log(error);