tods-competition-factory 1.6.10 → 1.6.11

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.
@@ -1407,7 +1407,7 @@ function structureSort(a, b, config) {
1407
1407
  const completedStructure = (s) => s?.matchUps.every(
1408
1408
  ({ matchUpStatus }) => completedMatchUpStatuses.includes(matchUpStatus) ? 1 : -1
1409
1409
  );
1410
- return completed && completedStructure(a) - completedStructure(b) || aggregate && protocolSequence(a) - protocolSequence(b) || (a?.stage && orderProtocol[a.stage] || 0) - (b?.stage && orderProtocol[b.stage] || 0) || (getRoundTarget(a) || 0) - (getRoundTarget(b) || 0) || !finish && !aggregate && (b?.positionAssignments?.length || Infinity) - (a?.positionAssignments?.length || Infinity) || (a?.stageSequence || 0) - (b?.stageSequence || 0) || (getMinFinishingPositionRange(a) || 0) - (getMinFinishingPositionRange(b) || 0);
1410
+ return completed && completedStructure(a) - completedStructure(b) || aggregate && protocolSequence(a) - protocolSequence(b) || (a?.stage && orderProtocol[a.stage] || 0) - (b?.stage && orderProtocol[b.stage] || 0) || (getRoundTarget(a) || 0) - (getRoundTarget(b) || 0) || !finish && !aggregate && (b?.positionAssignments?.length ?? Infinity) - (a?.positionAssignments?.length ?? Infinity) || (a?.stageSequence ?? 0) - (b?.stageSequence ?? 0) || (getMinFinishingPositionRange(a) || 0) - (getMinFinishingPositionRange(b) || 0);
1411
1411
  }
1412
1412
  function getMinFinishingPositionRange(structure) {
1413
1413
  return (structure?.matchUps || []).reduce((rangeSum, matchUp) => {
@@ -1517,6 +1517,7 @@ const STRUCTURE_SELECTED_STATUSES = [
1517
1517
 
1518
1518
  function getStageEntries$1({
1519
1519
  provisionalPositioning,
1520
+ placementGroup,
1520
1521
  drawDefinition,
1521
1522
  stageSequence,
1522
1523
  entryStatuses,
@@ -1546,7 +1547,9 @@ function getStageEntries$1({
1546
1547
  if (error) {
1547
1548
  console.log("playoff entries error");
1548
1549
  }
1549
- return playoffEntries?.length ? playoffEntries : entries;
1550
+ return (playoffEntries?.length ? playoffEntries : entries).filter(
1551
+ (entry) => !placementGroup || entry.placementGroup === placementGroup
1552
+ );
1550
1553
  }
1551
1554
  return entries;
1552
1555
  }