tods-competition-factory 1.6.13 → 1.6.17

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.
package/dist/index.mjs CHANGED
@@ -329,7 +329,7 @@ const matchUpFormatCode = {
329
329
  };
330
330
 
331
331
  function factoryVersion() {
332
- return "1.6.13";
332
+ return "1.6.17";
333
333
  }
334
334
 
335
335
  function getObjectTieFormat(obj) {
@@ -7653,7 +7653,7 @@ function getSide({
7653
7653
  sideNumber
7654
7654
  }) {
7655
7655
  const assignment = positionAssignments.find(
7656
- (assignment2) => assignment2.drawPosition === drawPosition
7656
+ (assignment2) => assignment2.drawPosition && assignment2.drawPosition === drawPosition
7657
7657
  );
7658
7658
  const participantId = drawPositionCollectionAssignment ? drawPositionCollectionAssignment[drawPosition]?.participantId : assignment?.participantId;
7659
7659
  const sideValue = assignment ? getSideValue$1({
@@ -60272,15 +60272,18 @@ function generateSet({
60272
60272
  function completeDrawMatchUps(params) {
60273
60273
  const {
60274
60274
  matchUpStatusProfile,
60275
+ // { matchUpStatusProfile: {} } will always return only { matchUpStatus: COMPLETED }
60275
60276
  completeAllMatchUps,
60276
60277
  // qualifyingProfiles, // CONSIDER: allowing completionGoal per structureProfile
60277
60278
  randomWinningSide,
60278
60279
  tournamentRecord,
60279
- drawDefinition,
60280
60280
  completionGoal,
60281
- matchUpFormat,
60281
+ drawDefinition,
60282
60282
  event
60283
60283
  } = params;
60284
+ if (!drawDefinition)
60285
+ return { error: MISSING_DRAW_DEFINITION };
60286
+ const matchUpFormat = params.matchUpFormat || drawDefinition.matchUpFormat || event?.matchUpFormat;
60284
60287
  const sortedStructures = drawDefinition.structures.slice().sort(structureSort);
60285
60288
  let completedCount = 0;
60286
60289
  const { matchUps: firstRoundDualMatchUps, matchUpsMap } = getAllDrawMatchUps({
@@ -62510,6 +62513,7 @@ const mocksGovernor = {
62510
62513
  generateOutcomeFromScoreString,
62511
62514
  generateTournamentRecord,
62512
62515
  generateEventWithDraw,
62516
+ completeDrawMatchUps,
62513
62517
  generateParticipants,
62514
62518
  parseScoreString,
62515
62519
  generateOutcome,