tods-competition-factory 1.7.9 → 1.7.10

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.
@@ -16595,20 +16595,20 @@ function evaluateCollectionResult({
16595
16595
  if (matchUp.winningSide)
16596
16596
  sideWins[matchUp.winningSide - 1] += 1;
16597
16597
  });
16598
- if (matchUpValue) {
16598
+ if (isConvertableInteger(matchUpValue)) {
16599
16599
  collectionMatchUps.forEach((matchUp) => {
16600
16600
  if (matchUp.winningSide) {
16601
16601
  sideMatchUpValues[matchUp.winningSide - 1] += matchUpValue;
16602
16602
  }
16603
16603
  });
16604
- } else if (setValue) {
16604
+ } else if (isConvertableInteger(setValue)) {
16605
16605
  collectionMatchUps.forEach((matchUp) => {
16606
16606
  matchUp.score?.sets?.forEach((set) => {
16607
16607
  if (set.winningSide)
16608
16608
  sideMatchUpValues[set.winningSide - 1] += setValue;
16609
16609
  });
16610
16610
  });
16611
- } else if (scoreValue) {
16611
+ } else if (isConvertableInteger(scoreValue)) {
16612
16612
  collectionMatchUps.forEach((matchUp) => {
16613
16613
  matchUp.score?.sets?.forEach((set) => {
16614
16614
  const {
@@ -16635,15 +16635,17 @@ function evaluateCollectionResult({
16635
16635
  collectionDefinition,
16636
16636
  collectionPosition
16637
16637
  });
16638
- sideMatchUpValues[matchUp.winningSide - 1] += matchUpValue2;
16638
+ if (isConvertableInteger(matchUpValue2)) {
16639
+ sideMatchUpValues[matchUp.winningSide - 1] += matchUpValue2;
16640
+ }
16639
16641
  }
16640
16642
  });
16641
16643
  }
16642
- if (collectionValue) {
16644
+ if (isConvertableInteger(collectionValue)) {
16643
16645
  let collectionWinningSide;
16644
16646
  if (winCriteria?.aggregateValue) {
16645
16647
  if (allCollectionMatchUpsCompleted) {
16646
- if ((matchUpValue || setValue || scoreValue) && sideMatchUpValues[0] !== sideMatchUpValues[1]) {
16648
+ if (isConvertableInteger(matchUpValue || setValue || scoreValue) && sideMatchUpValues[0] !== sideMatchUpValues[1]) {
16647
16649
  collectionWinningSide = sideMatchUpValues[0] > sideMatchUpValues[1] ? 1 : 2;
16648
16650
  } else if (sideWins[0] !== sideWins[1]) {
16649
16651
  collectionWinningSide = sideWins[0] > sideWins[1] ? 1 : 2;
@@ -16679,7 +16681,7 @@ function evaluateCollectionResult({
16679
16681
  }
16680
16682
  if (!belongsToValueGroup) {
16681
16683
  sideCollectionValues.forEach(
16682
- (sideCollectionValue, i) => sideTieValues[i] += sideCollectionValue
16684
+ (sideCollectionValue, i) => sideTieValues[i] += sideCollectionValue || 0
16683
16685
  );
16684
16686
  } else {
16685
16687
  groupValueGroups[collectionGroupNumber].sideWins[0] += sideWins[0] || 0;
@@ -16704,7 +16706,9 @@ function getGroupValueGroups({
16704
16706
  }) {
16705
16707
  const groupValueGroups = Object.assign(
16706
16708
  {},
16707
- ...collectionGroups.filter((group) => group?.groupValue && group?.groupNumber).map((group) => ({
16709
+ ...collectionGroups.filter(
16710
+ (group) => isConvertableInteger(group?.groupValue) && group?.groupNumber
16711
+ ).map((group) => ({
16708
16712
  [group.groupNumber]: {
16709
16713
  ...group,
16710
16714
  allGroupMatchUpsCompleted: true,
@@ -16781,11 +16785,11 @@ function generateTieMatchUpScore(params) {
16781
16785
  }, void 0);
16782
16786
  }
16783
16787
  if (groupWinningSide) {
16784
- sideTieValues[groupWinningSide - 1] += groupValue;
16788
+ sideTieValues[groupWinningSide - 1] += groupValue || 0;
16785
16789
  }
16786
16790
  }
16787
16791
  const sideScores = sideTieValues.map(
16788
- (sideTieValue, i) => sideTieValue + sideAdjustments[i]
16792
+ (sideTieValue, i) => (sideTieValue || 0) + sideAdjustments[i]
16789
16793
  );
16790
16794
  const set = {
16791
16795
  side1Score: sideScores[0],