tods-competition-factory 0.167.0 → 0.168.0

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.167.0';
252
+ return '0.168.0';
253
253
  }
254
254
 
255
255
  function isPowerOf2(n) {
@@ -20910,41 +20910,35 @@ function assignSeed({
20910
20910
  };
20911
20911
  }
20912
20912
 
20913
- if (seedNumbers.includes(seedNumber) || [CONSOLATION, PLAY_OFF].includes(structure === null || structure === void 0 ? void 0 : structure.stage)) {
20914
- const seedNumbers = seedAssignments.map(({
20915
- seedNumber
20916
- }) => seedNumber);
20913
+ if (!seedNumbers.includes(seedNumber)) {
20914
+ seedAssignments.push({
20915
+ seedNumber,
20916
+ seedValue
20917
+ });
20918
+ }
20917
20919
 
20918
- if (!seedNumbers.includes(seedNumber)) {
20919
- seedAssignments.push({
20920
- seedNumber,
20921
- seedValue
20922
- });
20923
- }
20920
+ let success;
20921
+ seedAssignments.forEach(assignment => {
20922
+ // ensure that this participantId is not assigned to any other seedNumber
20923
+ if (assignment.participantId === participantId && assignment.seedNumber !== seedNumber) {
20924
+ assignment.participantId = undefined;
20925
+ } // assign participantId to target seedNumber
20924
20926
 
20925
- let success;
20926
- seedAssignments.forEach(assignment => {
20927
- // ensure that this participantId is not assigned to any other seedNumber
20928
- if (assignment.participantId === participantId && assignment.seedNumber !== seedNumber) {
20929
- assignment.participantId = undefined;
20930
- } // assign participantId to target seedNumber
20931
20927
 
20928
+ if (assignment.seedNumber === seedNumber) {
20929
+ assignment.participantId = participantId;
20930
+ assignment.seedValue = seedValue || seedNumber;
20931
+ success = true;
20932
+ }
20933
+ });
20932
20934
 
20933
- if (assignment.seedNumber === seedNumber) {
20934
- assignment.participantId = participantId;
20935
- assignment.seedValue = seedValue || seedNumber;
20936
- success = true;
20937
- }
20935
+ if (success) {
20936
+ modifyDrawNotice({
20937
+ drawDefinition,
20938
+ structureIds: [structureId]
20938
20939
  });
20939
-
20940
- if (success) {
20941
- modifyDrawNotice({
20942
- drawDefinition,
20943
- structureIds: [structureId]
20944
- });
20945
- return { ...SUCCESS
20946
- };
20947
- }
20940
+ return { ...SUCCESS
20941
+ };
20948
20942
  }
20949
20943
 
20950
20944
  return {
@@ -21531,8 +21525,8 @@ function directLoser(params) {
21531
21525
  const {
21532
21526
  positionAssignments: sourcePositionAssignments
21533
21527
  } = structureAssignedDrawPositions({
21534
- drawDefinition,
21535
- structureId: sourceStructureId
21528
+ structureId: sourceStructureId,
21529
+ drawDefinition
21536
21530
  });
21537
21531
  const relevantAssignment = sourcePositionAssignments.find(assignment => assignment.drawPosition === loserDrawPosition);
21538
21532
  const loserParticipantId = relevantAssignment === null || relevantAssignment === void 0 ? void 0 : relevantAssignment.participantId;