tods-competition-factory 2.0.33 → 2.0.35

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.
@@ -7335,9 +7335,12 @@ type ValidateCollectionDefinitionArgs = {
7335
7335
  declare function validateCollectionDefinition({ checkCategory, collectionDefinition, checkCollectionIds, checkGender, referenceCategory, referenceGender, event, }: ValidateCollectionDefinitionArgs): ResultType;
7336
7336
 
7337
7337
  type CompareTieFormatsArgs = {
7338
- considerations?: any;
7339
- descendant: TieFormat;
7338
+ considerations?: {
7339
+ collectionName?: boolean;
7340
+ collectionOrder?: boolean;
7341
+ };
7340
7342
  ancestor: TieFormat;
7343
+ descendant: any;
7341
7344
  };
7342
7345
  declare function compareTieFormats({ considerations, descendant, ancestor }: CompareTieFormatsArgs): {
7343
7346
  different: any;
@@ -8891,6 +8894,10 @@ declare function addCollectionDefinition({ updateInProgressMatchUps, collectionD
8891
8894
  };
8892
8895
 
8893
8896
  type ModifyTieFormatArgs = {
8897
+ considerations?: {
8898
+ collectionName?: boolean;
8899
+ collectionOrder?: boolean;
8900
+ };
8894
8901
  updateInProgressMatchUps?: boolean;
8895
8902
  tieFormatComparison?: boolean;
8896
8903
  tournamentRecord: Tournament;
@@ -8902,7 +8909,7 @@ type ModifyTieFormatArgs = {
8902
8909
  uuids?: string[];
8903
8910
  event?: Event$1;
8904
8911
  };
8905
- declare function modifyTieFormat({ updateInProgressMatchUps, tieFormatComparison, modifiedTieFormat, tournamentRecord, drawDefinition, structureId, matchUpId, eventId, uuids, event, }: ModifyTieFormatArgs): ResultType | {
8912
+ declare function modifyTieFormat({ updateInProgressMatchUps, tieFormatComparison, modifiedTieFormat, tournamentRecord, considerations, drawDefinition, structureId, matchUpId, eventId, uuids, event, }: ModifyTieFormatArgs): ResultType | {
8906
8913
  success: boolean;
8907
8914
  processedTieFormat: any;
8908
8915
  modifications: any[];
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  function factoryVersion() {
6
- return '2.0.33';
6
+ return '2.0.35';
7
7
  }
8
8
 
9
9
  function isFunction(obj) {
@@ -31768,9 +31768,9 @@ const namedFormats = {
31768
31768
  [COLLEGE_D3$1]: {
31769
31769
  hydrate: true,
31770
31770
  doubles: {
31771
+ matchUpFormat: 'SET1-S:8/TB7@7',
31771
31772
  matchUpCount: 3,
31772
31773
  matchUpValue: 1,
31773
- matchUpFormat: 'SET1-S:8/TB7@7',
31774
31774
  },
31775
31775
  singles: {
31776
31776
  matchUpFormat: FORMAT_STANDARD,
@@ -31783,14 +31783,14 @@ const namedFormats = {
31783
31783
  [COLLEGE_DEFAULT$1]: {
31784
31784
  hydrate: true,
31785
31785
  doubles: {
31786
- matchUpCount: 3,
31786
+ matchUpFormat: 'SET1-S:6/TB7',
31787
31787
  collectionValue: 1,
31788
- matchUpFormat: FORMAT_STANDARD,
31788
+ matchUpCount: 3,
31789
31789
  },
31790
31790
  singles: {
31791
+ matchUpFormat: FORMAT_STANDARD,
31791
31792
  matchUpCount: 6,
31792
31793
  matchUpValue: 1,
31793
- matchUpFormat: FORMAT_STANDARD,
31794
31794
  },
31795
31795
  tieFormatName: COLLEGE_DEFAULT$1,
31796
31796
  valueGoal: 4,
@@ -31798,14 +31798,14 @@ const namedFormats = {
31798
31798
  [COLLEGE_JUCO$1]: {
31799
31799
  hydrate: true,
31800
31800
  doubles: {
31801
+ matchUpFormat: 'SET1-S:8/TB7',
31801
31802
  matchUpCount: 3,
31802
31803
  matchUpValue: 1,
31803
- matchUpFormat: 'SET1-S:8/TB7',
31804
31804
  },
31805
31805
  singles: {
31806
+ matchUpFormat: FORMAT_STANDARD,
31806
31807
  matchUpCount: 6,
31807
31808
  matchUpValue: 1,
31808
- matchUpFormat: FORMAT_STANDARD,
31809
31809
  },
31810
31810
  tieFormatName: COLLEGE_JUCO$1,
31811
31811
  valueGoal: 5,
@@ -33566,17 +33566,17 @@ function getCollectionsValue(definitions) {
33566
33566
  scoreValue,
33567
33567
  setValue,
33568
33568
  };
33569
- const valueKeys = Object.keys(valueAssignments).filter((key) => ![undefined, null].includes(valueAssignments[key]));
33570
- if (valueKeys.length !== 1) {
33569
+ const valueKeys = Object.keys(valueAssignments).filter((key) => ![undefined, null].includes(valueAssignments[key]) &&
33570
+ (!Array.isArray(valueAssignments[key]) || valueAssignments[key].length > 0));
33571
+ if (valueKeys.length !== 1)
33571
33572
  invalidValues.push({ collectionId });
33572
- }
33573
33573
  const valueKey = valueKeys[0];
33574
33574
  if (valueKey) {
33575
33575
  const value = valueKey === 'collectionValueProfiles' ? Object.values(collectionValueProfiles) : valueAssignments[valueKey];
33576
33576
  assignmentValues.push({ valueKey, value });
33577
33577
  }
33578
33578
  totalMatchUps += matchUpCount;
33579
- if (collectionValueProfiles)
33579
+ if (collectionValueProfiles?.length)
33580
33580
  return total + collectionValueProfiles.reduce((total, profile) => total + profile.value, 0);
33581
33581
  if (matchUpCount) {
33582
33582
  if (isConvertableInteger(matchUpValue))
@@ -36161,7 +36161,7 @@ function calculateWinCriteria({ collectionDefinitions = [], collectionGroups = [
36161
36161
  else if (typeof collectionValue === 'number' && isConvertableInteger(collectionValue)) {
36162
36162
  valueTotal += collectionValue;
36163
36163
  }
36164
- else if (collectionValueProfiles?.length) {
36164
+ else if (Array.isArray(collectionValueProfiles) && collectionValueProfiles?.length) {
36165
36165
  for (const collectionValueProfile of collectionValueProfiles) {
36166
36166
  valueTotal += collectionValueProfile.matchUpValue;
36167
36167
  }
@@ -53865,7 +53865,7 @@ function modifyCollectionDefinition({ updateInProgressMatchUps = false, tourname
53865
53865
  stack,
53866
53866
  });
53867
53867
  const value = collectionValue ?? matchUpValue ?? scoreValue ?? setValue;
53868
- if (collectionValueProfiles) {
53868
+ if (collectionValueProfiles?.length) {
53869
53869
  const result = validateCollectionValueProfiles({
53870
53870
  matchUpCount: matchUpCount ?? sourceCollectionDefinition?.matchUpCount ?? 0,
53871
53871
  collectionValueProfiles,
@@ -54194,7 +54194,7 @@ function getOrderedTieFormat({ tieFormat, orderMap }) {
54194
54194
  if (collectionOrder)
54195
54195
  collectionDefinition.collectionOrder = collectionOrder;
54196
54196
  });
54197
- orderedTieFormat.collectionDefinitions.sort((a, b) => numericSortValue(a.collectionOrder) - numericSortValue(b.collectionOrder));
54197
+ orderedTieFormat.collectionDefinitions?.sort((a, b) => numericSortValue(a.collectionOrder) - numericSortValue(b.collectionOrder));
54198
54198
  return orderedTieFormat;
54199
54199
  }
54200
54200
  function orderCollectionDefinitions({ tournamentRecord, drawDefinition, structureId, matchUpId, orderMap, eventId, matchUp, event, }) {
@@ -54835,7 +54835,7 @@ function queueNoficiations({ modifiedStructureIds, tournamentRecord, modifiedMat
54835
54835
  });
54836
54836
  }
54837
54837
 
54838
- function modifyTieFormat({ updateInProgressMatchUps = false, tieFormatComparison, modifiedTieFormat, tournamentRecord, drawDefinition, structureId, matchUpId, eventId, uuids, event, }) {
54838
+ function modifyTieFormat({ updateInProgressMatchUps = false, tieFormatComparison, modifiedTieFormat, tournamentRecord, considerations, drawDefinition, structureId, matchUpId, eventId, uuids, event, }) {
54839
54839
  const stack = 'modifyTieFormat';
54840
54840
  if (!validateTieFormat({ tieFormat: modifiedTieFormat }).valid) {
54841
54841
  return decorateResult({
@@ -54858,6 +54858,7 @@ function modifyTieFormat({ updateInProgressMatchUps = false, tieFormatComparison
54858
54858
  const comparison = compareTieFormats({
54859
54859
  descendant: modifiedTieFormat,
54860
54860
  ancestor: tieFormat,
54861
+ considerations,
54861
54862
  });
54862
54863
  if (comparison.invalid) {
54863
54864
  return decorateResult({