tods-competition-factory 1.8.22 → 1.8.23

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.
@@ -5061,7 +5061,7 @@ function getMatchUpFormatTiming({
5061
5061
  }) {
5062
5062
  if (!tournamentRecord)
5063
5063
  return { error: MISSING_TOURNAMENT_RECORD };
5064
- eventType = eventType || event?.eventType || TypeEnum.Singles;
5064
+ eventType = eventType ?? event?.eventType ?? TypeEnum.Singles;
5065
5065
  const defaultTiming = {
5066
5066
  averageTimes: [{ minutes: { default: defaultAverageMinutes } }],
5067
5067
  recoveryTimes: [{ minutes: { default: defaultRecoveryMinutes } }]
@@ -5389,7 +5389,7 @@ function findVenue({
5389
5389
  if (!venue && tournamentRecords) {
5390
5390
  const linkedTournamentIds = getLinkedTournamentIds({
5391
5391
  tournamentRecords
5392
- }).linkedTournamentIds || [];
5392
+ }).linkedTournamentIds ?? [];
5393
5393
  const relevantIds = linkedTournamentIds[tournamentRecord.tournamentId];
5394
5394
  for (const tournamentId of relevantIds) {
5395
5395
  const record = tournamentRecords[tournamentId];
@@ -5931,7 +5931,7 @@ function getPairedParticipant({
5931
5931
  result: { error: MISSING_PARTICIPANT_IDS },
5932
5932
  stack
5933
5933
  });
5934
- tournamentParticipants = tournamentParticipants || tournamentRecord?.participants || [];
5934
+ tournamentParticipants = tournamentParticipants ?? tournamentRecord?.participants ?? [];
5935
5935
  const existingPairedParticipants = tournamentParticipants.filter(
5936
5936
  (participant) => participant.participantType === PAIR && intersection(participantIds, participant.individualParticipantIds).length === participantIds.length && participant.individualParticipantIds.length === participantIds.length
5937
5937
  );
@@ -6809,7 +6809,7 @@ function getRoundContextProfile({
6809
6809
  ...(drawDefinition?.structures ?? []).filter((structure2) => structure2.stage === QUALIFYING).map(({ stageSequence }) => stageSequence ?? 1),
6810
6810
  0
6811
6811
  ) : 0;
6812
- const preQualifyingSequence = qualifyingStageSequences ? qualifyingStageSequences - (structure.stageSequence || 1) || "" : "";
6812
+ const preQualifyingSequence = qualifyingStageSequences ? qualifyingStageSequences - (structure.stageSequence ?? 1) || "" : "";
6813
6813
  const preQualifyingAffix = preQualifyingSequence ? roundNamingPolicy?.affixes?.preQualifying || defaultRoundNamingPolicy.affixes.preQualifying || "" : "";
6814
6814
  const roundNamingMap = roundNamingPolicy?.roundNamingMap || defaultRoundNamingPolicy.roundNamingMap || {};
6815
6815
  const abbreviatedRoundNamingMap = roundNamingPolicy?.abbreviatedRoundNamingMap || defaultRoundNamingPolicy.abbreviatedRoundNamingMap || {};
@@ -7108,7 +7108,13 @@ function getAllStructureMatchUps({
7108
7108
  matchUps
7109
7109
  }));
7110
7110
  }
7111
- return { matchUps, roundMatchUps, roundProfile, collectionPositionMatchUps };
7111
+ return {
7112
+ collectionPositionMatchUps,
7113
+ roundMatchUps,
7114
+ roundProfile,
7115
+ matchUpsMap,
7116
+ matchUps
7117
+ };
7112
7118
  function addMatchUpContext({
7113
7119
  scheduleVisibilityFilters: scheduleVisibilityFilters2,
7114
7120
  sourceDrawPositionRanges,
@@ -8554,7 +8560,7 @@ function parseScoreString({
8554
8560
  isSide1: winningSide === 2,
8555
8561
  tiebreakTo
8556
8562
  });
8557
- const setTiebreak = side1TiebreakPerspective || [];
8563
+ const setTiebreak = side1TiebreakPerspective ?? [];
8558
8564
  const [side1Score, side2Score] = setScores || [];
8559
8565
  const [side1TiebreakScore, side2TiebreakScore] = matchTiebreak || setTiebreak || [];
8560
8566
  return {
@@ -9869,12 +9875,12 @@ function matchUpActions$1({
9869
9875
  if (!tournamentRecord)
9870
9876
  return { error: MISSING_TOURNAMENT_RECORD };
9871
9877
  if (!drawId) {
9872
- const matchUps = allTournamentMatchUps({ tournamentRecord }).matchUps || [];
9878
+ const matchUps = allTournamentMatchUps({ tournamentRecord }).matchUps ?? [];
9873
9879
  drawId = matchUps.reduce((drawId2, candidate) => {
9874
9880
  return candidate.matchUpId === matchUpId ? candidate.drawId : drawId2;
9875
9881
  }, void 0);
9876
- const events = tournamentRecord.events || [];
9877
- const drawDefinitions = events.map((event2) => event2.drawDefinitions || []).flat();
9882
+ const events = tournamentRecord.events ?? [];
9883
+ const drawDefinitions = events.map((event2) => event2.drawDefinitions ?? []).flat();
9878
9884
  drawDefinition = drawDefinitions.reduce(
9879
9885
  (drawDefinition2, candidate) => {
9880
9886
  return candidate.drawId === drawId ? candidate : drawDefinition2;
@@ -9888,7 +9894,7 @@ function matchUpActions$1({
9888
9894
  drawDefinition,
9889
9895
  event
9890
9896
  });
9891
- policyDefinitions = policyDefinitions || attachedPolicy;
9897
+ policyDefinitions = policyDefinitions ?? attachedPolicy;
9892
9898
  if (drawDefinition) {
9893
9899
  return matchUpActions$2({
9894
9900
  tournamentParticipants: tournamentRecord.participants,
@@ -9959,7 +9965,6 @@ function getVenuesAndCourts({
9959
9965
  tournamentIds.forEach((tournamentId) => {
9960
9966
  const tournamentRecord = tournamentRecords[tournamentId];
9961
9967
  for (const venue of tournamentRecord.venues || []) {
9962
- tournamentRecord.venues;
9963
9968
  if (venueIds.length && !venueIds.includes(venue.venueId))
9964
9969
  continue;
9965
9970
  if (ignoreDisabled) {
@@ -10558,12 +10563,12 @@ function getParticipantEventDetails({
10558
10563
  if (!participantId)
10559
10564
  return { error: MISSING_PARTICIPANT_ID };
10560
10565
  const relevantParticipantIds = [participantId].concat(
10561
- (tournamentRecord.participants || []).filter(
10566
+ (tournamentRecord.participants ?? []).filter(
10562
10567
  (participant) => participant?.participantType && [TEAM$2, PAIR].includes(participant.participantType) && participant.individualParticipantIds?.includes(participantId)
10563
10568
  ).map((participant) => participant.participantId)
10564
10569
  );
10565
- const relevantEvents = (tournamentRecord.events || []).filter((event) => {
10566
- const enteredParticipantIds = (event?.entries || []).map(
10570
+ const relevantEvents = (tournamentRecord.events ?? []).filter((event) => {
10571
+ const enteredParticipantIds = (event?.entries ?? []).map(
10567
10572
  (entry) => entry.participantId
10568
10573
  );
10569
10574
  return overlap(enteredParticipantIds, relevantParticipantIds);
@@ -11355,7 +11360,7 @@ function filterParticipants({
11355
11360
  );
11356
11361
  if (event.eventType === SINGLES)
11357
11362
  return enteredParticipantIds;
11358
- const individualParticipantIds = (tournamentRecord?.participants || []).filter(
11363
+ const individualParticipantIds = (tournamentRecord?.participants ?? []).filter(
11359
11364
  (participant) => enteredParticipantIds.includes(participant.participantId)
11360
11365
  ).map((participant) => participant.individualParticipantIds).flat(1);
11361
11366
  return enteredParticipantIds.concat(...individualParticipantIds);
@@ -13074,7 +13079,7 @@ function getContainedStructures({
13074
13079
  const containerStructures = {};
13075
13080
  const structureContainers = drawDefinitions.map((dd) => dd?.structures?.filter((structure) => structure?.structures)).flat().filter(Boolean);
13076
13081
  for (const structureContainer of structureContainers) {
13077
- const { structures, structureId } = structureContainer || {};
13082
+ const { structures, structureId } = structureContainer ?? {};
13078
13083
  structures && structureId && (containedStructures[structureId] = structures?.map(
13079
13084
  (structure) => structure.structureId
13080
13085
  )) && structures.forEach(