tods-competition-factory 1.6.11 → 1.6.13

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.
@@ -3867,7 +3867,7 @@ function validMatchUp(matchUp) {
3867
3867
  const { matchUpId, drawPositions } = matchUp;
3868
3868
  const validMatchUpId = typeof matchUpId === "string";
3869
3869
  const validDrawPositions = !drawPositions || Array.isArray(drawPositions) && drawPositions.length <= 2 && drawPositions.every(
3870
- (dp) => isConvertableInteger(dp) || dp === void 0
3870
+ (dp) => isConvertableInteger(dp) || dp === void 0 || dp === null
3871
3871
  );
3872
3872
  return validMatchUpId && validDrawPositions;
3873
3873
  }
@@ -6280,9 +6280,10 @@ function getSourceDrawPositionRanges({
6280
6280
  structureId: sourceStructureId,
6281
6281
  matchUpsMap
6282
6282
  });
6283
- const { roundProfile } = getRoundMatchUps({
6283
+ const roundMatchUpsResult = getRoundMatchUps({
6284
6284
  matchUps: structureMatchUps2
6285
6285
  });
6286
+ const roundProfile = roundMatchUpsResult.roundProfile;
6286
6287
  return { [sourceStructureId]: roundProfile };
6287
6288
  })
6288
6289
  );
@@ -11494,7 +11495,7 @@ function getValidSeedBlocks({
11494
11495
  });
11495
11496
  const { positionAssignments } = structureAssignedDrawPositions({ structure });
11496
11497
  const positionsCount = positionAssignments?.length;
11497
- const seedsCount = seedAssignments?.length || 0;
11498
+ const seedsCount = seedAssignments?.length ?? 0;
11498
11499
  let allDrawPositions = [];
11499
11500
  const roundNumbers = Object.keys(roundMatchUps).map((n) => parseInt(n)).sort((a, b) => a - b);
11500
11501
  const uniqueDrawPositionsByRound = roundNumbers.map((roundNumber) => {
@@ -11756,7 +11757,7 @@ function getNextSeedBlock(params) {
11756
11757
  const seedsWithoutDrawPositions = seedAssignments?.filter(
11757
11758
  (assignment) => !assignment.participantId
11758
11759
  );
11759
- const seedsLeftToAssign = unplacedSeedAssignments?.length || seedsWithoutDrawPositions?.length;
11760
+ const seedsLeftToAssign = unplacedSeedAssignments?.length && unplacedSeedAssignments.length > 0 ? unplacedSeedAssignments.length : seedsWithoutDrawPositions?.length ?? 0;
11760
11761
  const unfilled = seedsLeftToAssign && nextSeedBlock?.drawPositions.filter(
11761
11762
  (drawPosition) => !assignedDrawPositions?.includes(drawPosition)
11762
11763
  ) || [];