tods-competition-factory 0.90.2 → 0.90.3

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.
@@ -249,7 +249,7 @@ const matchUpFormatCode = {
249
249
  };
250
250
 
251
251
  function factoryVersion() {
252
- return '0.90.2';
252
+ return '0.90.3';
253
253
  }
254
254
 
255
255
  const FORMAT_STANDARD = 'SET3-S:6/TB7'; // Best of 3 Tiebreak Sets to 6
@@ -22771,7 +22771,7 @@ function addParticipant({
22771
22771
 
22772
22772
  const hasSchedule = ({
22773
22773
  scheduleAttributes = ['scheduledDate', 'scheduledTime'],
22774
- schedule
22774
+ schedule = {}
22775
22775
  }) => {
22776
22776
  const matchUpScheduleKeys = Object.keys(schedule).filter(key => scheduleAttributes.includes(key)).filter(key => schedule[key]);
22777
22777
  return !!matchUpScheduleKeys.length;
@@ -22787,7 +22787,7 @@ function participantScheduledMatchUps({
22787
22787
  if (!Array.isArray(scheduleAttributes)) return {
22788
22788
  error: INVALID_VALUES
22789
22789
  };
22790
- const scheduledMatchUps = matchUps.filter(({
22790
+ const scheduledMatchUps = matchUps.filter(Boolean).filter(({
22791
22791
  schedule
22792
22792
  }) => hasSchedule({
22793
22793
  schedule,
@@ -23800,7 +23800,9 @@ function annotateParticipant({
23800
23800
  scheduledMinutesDifference
23801
23801
  } = scheduleAnalysis || {};
23802
23802
  Object.keys(scheduledMatchUps).forEach(date => {
23803
- scheduledMatchUps[date].forEach((matchUp, i) => {
23803
+ scheduledMatchUps[date].filter(Boolean).forEach((matchUp, i) => {
23804
+ var _matchUp$schedule;
23805
+
23804
23806
  const {
23805
23807
  schedule: {
23806
23808
  scheduledTime,
@@ -23823,7 +23825,7 @@ function annotateParticipant({
23823
23825
  roundNumber,
23824
23826
  roundPosition,
23825
23827
  ...matchUp.schedule,
23826
- scheduledTime: extractTime(matchUp.schedule.scheduledTime)
23828
+ scheduledTime: extractTime((_matchUp$schedule = matchUp.schedule) === null || _matchUp$schedule === void 0 ? void 0 : _matchUp$schedule.scheduledTime)
23827
23829
  }); // matchUps with { matchUpStatus: BYE } are ignored
23828
23830
 
23829
23831
  if (scheduledTime && matchUpStatus !== BYE) {
@@ -23836,18 +23838,20 @@ function annotateParticipant({
23836
23838
 
23837
23839
  // ignore { matchUpStatus: BYE } and matchUps which are unscheduled
23838
23840
  if (matchUpStatus !== BYE && (_consideredMatchUp$sc = consideredMatchUp.schedule) !== null && _consideredMatchUp$sc !== void 0 && _consideredMatchUp$sc.scheduledTime) {
23841
+ var _consideredMatchUp$sc2, _consideredMatchUp$sc3;
23842
+
23839
23843
  // if there is a matchType change (SINGLES => DOUBLES or vice versa) then there is potentially a different timeAfterRecovery
23840
23844
  const typeChange = matchUp.matchUpType !== consideredMatchUp.matchUpType;
23841
23845
  const notBeforeTime = typeChange ? typeChangeTimeAfterRecovery || timeAfterRecovery : timeAfterRecovery; // if two matchUps are both potentials and both part of the same draw they cannot be considered in conflict
23842
23846
 
23843
23847
  const sameDraw = matchUp.drawId === consideredMatchUp.drawId;
23844
23848
  const bothPotential = matchUp.potential && consideredMatchUp.potential;
23845
- const nextMinutes = timeStringMinutes(consideredMatchUp.schedule.scheduledTime);
23849
+ const nextMinutes = timeStringMinutes((_consideredMatchUp$sc2 = consideredMatchUp.schedule) === null || _consideredMatchUp$sc2 === void 0 ? void 0 : _consideredMatchUp$sc2.scheduledTime);
23846
23850
  const minutesDifference = nextMinutes - scheduledMinutes; // Conflicts can be determined in two ways:
23847
23851
  // 1. scheduledMinutesDifference - the minutes difference between two scheduledTimes
23848
23852
  // 2. A scheduledTime occurring before a prior matchUps notBeforeTime (timeAfterRecovery)
23849
23853
 
23850
- const timeOverlap = scheduledMinutesDifference && !isNaN(scheduledMinutesDifference) ? minutesDifference <= scheduledMinutesDifference : timeStringMinutes(notBeforeTime) > timeStringMinutes(consideredMatchUp.schedule.scheduledTime); // if there is a time overlap capture both the prior matchUpId and the conflicted matchUpId
23854
+ const timeOverlap = scheduledMinutesDifference && !isNaN(scheduledMinutesDifference) ? minutesDifference <= scheduledMinutesDifference : timeStringMinutes(notBeforeTime) > timeStringMinutes((_consideredMatchUp$sc3 = consideredMatchUp.schedule) === null || _consideredMatchUp$sc3 === void 0 ? void 0 : _consideredMatchUp$sc3.scheduledTime); // if there is a time overlap capture both the prior matchUpId and the conflicted matchUpId
23851
23855
 
23852
23856
  if (timeOverlap && !(bothPotential && sameDraw)) {
23853
23857
  scheduleConflicts.push({