tods-competition-factory 2.0.34 → 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,7 +7335,10 @@ 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;
7338
+ considerations?: {
7339
+ collectionName?: boolean;
7340
+ collectionOrder?: boolean;
7341
+ };
7339
7342
  ancestor: TieFormat;
7340
7343
  descendant: any;
7341
7344
  };
@@ -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.34';
6
+ return '2.0.35';
7
7
  }
8
8
 
9
9
  function isFunction(obj) {
@@ -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({