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.
@@ -362,7 +362,7 @@ var matchUpFormatCode = {
362
362
  };
363
363
 
364
364
  function factoryVersion() {
365
- return '1.7.9';
365
+ return '1.7.10';
366
366
  }
367
367
 
368
368
  /******************************************************************************
@@ -5095,7 +5095,7 @@ function evaluateCollectionResult(_a) {
5095
5095
  if (matchUp.winningSide)
5096
5096
  sideWins[matchUp.winningSide - 1] += 1;
5097
5097
  });
5098
- if (matchUpValue) {
5098
+ if (isConvertableInteger(matchUpValue)) {
5099
5099
  // if tiebreak set count as set value and game value
5100
5100
  collectionMatchUps.forEach(function (matchUp) {
5101
5101
  if (matchUp.winningSide) {
@@ -5103,7 +5103,7 @@ function evaluateCollectionResult(_a) {
5103
5103
  }
5104
5104
  });
5105
5105
  }
5106
- else if (setValue) {
5106
+ else if (isConvertableInteger(setValue)) {
5107
5107
  collectionMatchUps.forEach(function (matchUp) {
5108
5108
  var _a, _b;
5109
5109
  (_b = (_a = matchUp.score) === null || _a === void 0 ? void 0 : _a.sets) === null || _b === void 0 ? void 0 : _b.forEach(function (set) {
@@ -5112,7 +5112,7 @@ function evaluateCollectionResult(_a) {
5112
5112
  });
5113
5113
  });
5114
5114
  }
5115
- else if (scoreValue) {
5115
+ else if (isConvertableInteger(scoreValue)) {
5116
5116
  collectionMatchUps.forEach(function (matchUp) {
5117
5117
  var _a, _b;
5118
5118
  (_b = (_a = matchUp.score) === null || _a === void 0 ? void 0 : _a.sets) === null || _b === void 0 ? void 0 : _b.forEach(function (set) {
@@ -5141,16 +5141,18 @@ function evaluateCollectionResult(_a) {
5141
5141
  collectionDefinition: collectionDefinition,
5142
5142
  collectionPosition: collectionPosition,
5143
5143
  });
5144
- sideMatchUpValues[matchUp.winningSide - 1] += matchUpValue_1;
5144
+ if (isConvertableInteger(matchUpValue_1)) {
5145
+ sideMatchUpValues[matchUp.winningSide - 1] += matchUpValue_1;
5146
+ }
5145
5147
  }
5146
5148
  });
5147
5149
  }
5148
5150
  // processed separately so that setValue, scoreValue and collecitonValueProfile can be used in conjunction with collectionValue
5149
- if (collectionValue) {
5151
+ if (isConvertableInteger(collectionValue)) {
5150
5152
  var collectionWinningSide = void 0;
5151
5153
  if (winCriteria === null || winCriteria === void 0 ? void 0 : winCriteria.aggregateValue) {
5152
5154
  if (allCollectionMatchUpsCompleted) {
5153
- if ((matchUpValue || setValue || scoreValue) &&
5155
+ if (isConvertableInteger(matchUpValue || setValue || scoreValue) &&
5154
5156
  sideMatchUpValues[0] !== sideMatchUpValues[1]) {
5155
5157
  collectionWinningSide =
5156
5158
  sideMatchUpValues[0] > sideMatchUpValues[1] ? 1 : 2;
@@ -5192,7 +5194,7 @@ function evaluateCollectionResult(_a) {
5192
5194
  }
5193
5195
  }
5194
5196
  if (!belongsToValueGroup) {
5195
- sideCollectionValues.forEach(function (sideCollectionValue, i) { return (sideTieValues[i] += sideCollectionValue); });
5197
+ sideCollectionValues.forEach(function (sideCollectionValue, i) { return (sideTieValues[i] += sideCollectionValue || 0); });
5196
5198
  }
5197
5199
  else {
5198
5200
  groupValueGroups[collectionGroupNumber].sideWins[0] += sideWins[0] || 0;
@@ -9830,7 +9832,9 @@ function getGroupValueGroups(_a) {
9830
9832
  var _b = _a.collectionGroups, collectionGroups = _b === void 0 ? [] : _b;
9831
9833
  // set up to handle groupValue
9832
9834
  var groupValueGroups = Object.assign.apply(Object, __spreadArray([{}], __read(collectionGroups
9833
- .filter(function (group) { return (group === null || group === void 0 ? void 0 : group.groupValue) && (group === null || group === void 0 ? void 0 : group.groupNumber); })
9835
+ .filter(function (group) {
9836
+ return isConvertableInteger(group === null || group === void 0 ? void 0 : group.groupValue) && (group === null || group === void 0 ? void 0 : group.groupNumber);
9837
+ })
9834
9838
  .map(function (group) {
9835
9839
  var _a;
9836
9840
  return (_a = {},
@@ -9907,7 +9911,7 @@ function generateTieMatchUpScore(params) {
9907
9911
  }, undefined);
9908
9912
  }
9909
9913
  if (groupWinningSide) {
9910
- sideTieValues[groupWinningSide - 1] += groupValue;
9914
+ sideTieValues[groupWinningSide - 1] += groupValue || 0;
9911
9915
  }
9912
9916
  };
9913
9917
  try {
@@ -9924,7 +9928,7 @@ function generateTieMatchUpScore(params) {
9924
9928
  }
9925
9929
  finally { if (e_2) throw e_2.error; }
9926
9930
  }
9927
- var sideScores = sideTieValues.map(function (sideTieValue, i) { return sideTieValue + sideAdjustments[i]; });
9931
+ var sideScores = sideTieValues.map(function (sideTieValue, i) { return (sideTieValue || 0) + sideAdjustments[i]; });
9928
9932
  var set = {
9929
9933
  side1Score: sideScores[0],
9930
9934
  side2Score: sideScores[1],
@@ -16697,7 +16701,7 @@ function calculateWinCriteria(_a) {
16697
16701
  var collectionValueProfiles = collectionDefinition.collectionValueProfiles, collectionGroupNumber = collectionDefinition.collectionGroupNumber, collectionValue = collectionDefinition.collectionValue, matchUpCount = collectionDefinition.matchUpCount, matchUpValue = collectionDefinition.matchUpValue, scoreValue = collectionDefinition.scoreValue, setValue = collectionDefinition.setValue;
16698
16702
  var belongsToValueGroup = collectionGroupNumber &&
16699
16703
  groupValueNumbers.includes(collectionGroupNumber);
16700
- if (setValue || scoreValue) {
16704
+ if (isConvertableInteger(setValue || scoreValue)) {
16701
16705
  // because setValues and scoreValues are unpredictable,
16702
16706
  // any collectionDefintion that has either of these two values without a collectionValue forces the tieFormat to aggregateValue
16703
16707
  aggregateValueImperative = true;
@@ -16705,7 +16709,8 @@ function calculateWinCriteria(_a) {
16705
16709
  else if (belongsToValueGroup) {
16706
16710
  continue;
16707
16711
  }
16708
- else if (collectionValue) {
16712
+ else if (typeof collectionValue === 'number' &&
16713
+ isConvertableInteger(collectionValue)) {
16709
16714
  valueTotal += collectionValue;
16710
16715
  }
16711
16716
  else if (collectionValueProfiles === null || collectionValueProfiles === void 0 ? void 0 : collectionValueProfiles.length) {
@@ -16723,13 +16728,10 @@ function calculateWinCriteria(_a) {
16723
16728
  finally { if (e_2) throw e_2.error; }
16724
16729
  }
16725
16730
  }
16726
- else if (matchUpValue) {
16731
+ else if (typeof matchUpValue === 'number' &&
16732
+ isConvertableInteger(matchUpValue)) {
16727
16733
  valueTotal += (matchUpCount || 0) * matchUpValue;
16728
16734
  }
16729
- else {
16730
- // default is to give each matchUp a value of 1
16731
- valueTotal += matchUpCount || 0;
16732
- }
16733
16735
  }
16734
16736
  }
16735
16737
  catch (e_1_1) { e_1 = { error: e_1_1 }; }