tods-competition-factory 1.7.6 → 1.7.7

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.
@@ -4891,7 +4891,8 @@ function resolveTieFormat({
4891
4891
 
4892
4892
  const add = (a, b) => (a || 0) + (b || 0);
4893
4893
  function getBand(spread, bandProfiles) {
4894
- return isNaN(spread) && WALKOVER || spread <= bandProfiles[DECISIVE] && DECISIVE || spread <= bandProfiles[ROUTINE] && ROUTINE || COMPETITIVE;
4894
+ const spreadValue = Array.isArray(spread) ? spread[0] : spread;
4895
+ return isNaN(spreadValue) && WALKOVER || spreadValue <= bandProfiles[DECISIVE] && DECISIVE || spreadValue <= bandProfiles[ROUTINE] && ROUTINE || COMPETITIVE;
4895
4896
  }
4896
4897
  function getScoreComponents({ score }) {
4897
4898
  const sets = score?.sets || [];
@@ -4943,7 +4944,8 @@ function getMatchUpCompetitiveProfile({
4943
4944
  const scoreComponents = getScoreComponents({ score });
4944
4945
  const spread = pctSpread([scoreComponents]);
4945
4946
  const competitiveness = getBand(spread, bandProfiles);
4946
- return { ...SUCCESS, competitiveness, pctSpread: spread };
4947
+ const pctSpreadValue = Array.isArray(spread) ? spread[0] : spread;
4948
+ return { ...SUCCESS, competitiveness, pctSpread: pctSpreadValue };
4947
4949
  }
4948
4950
 
4949
4951
  function findMatchupFormatAverageTimes(params) {
@@ -6771,6 +6773,9 @@ function isAdHoc({ drawDefinition, structure }) {
6771
6773
  const POLICY_ROUND_NAMING_DEFAULT = {
6772
6774
  [POLICY_TYPE_ROUND_NAMING]: {
6773
6775
  policyName: "Round Naming Default",
6776
+ namingConventions: {
6777
+ round: "Round"
6778
+ },
6774
6779
  abbreviatedRoundNamingMap: {
6775
6780
  // key is matchUpsCount for the round
6776
6781
  1: "F",
@@ -6810,6 +6815,9 @@ function getRoundContextProfile({
6810
6815
  const roundNamingMap = roundNamingPolicy?.roundNamingMap || defaultRoundNamingPolicy.roundNamingMap || {};
6811
6816
  const abbreviatedRoundNamingMap = roundNamingPolicy?.abbreviatedRoundNamingMap || defaultRoundNamingPolicy.abbreviatedRoundNamingMap || {};
6812
6817
  const roundNamePrefix = roundNamingPolicy?.affixes || defaultRoundNamingPolicy.affixes;
6818
+ const roundNumberAffix = roundNamePrefix.roundNumber || defaultRoundNamingPolicy.affixes.roundNumber;
6819
+ const namingConventions = roundNamingPolicy?.namingConventions || defaultRoundNamingPolicy.namingConventions;
6820
+ const roundNameFallback = namingConventions.round;
6813
6821
  const stageInitial = stage && stage !== MAIN && stage[0];
6814
6822
  const stageConstants = roundNamingPolicy?.stageConstants;
6815
6823
  const stageConstant = stage && stageConstants?.[stage] || stageInitial;
@@ -6818,8 +6826,8 @@ function getRoundContextProfile({
6818
6826
  Object.assign(
6819
6827
  roundNamingProfile,
6820
6828
  ...roundProfileKeys.map((key) => {
6821
- const roundName = `Round ${key}`;
6822
- const abbreviatedRoundName = `R${key}`;
6829
+ const roundName = `${roundNameFallback} ${key}`;
6830
+ const abbreviatedRoundName = `${roundNumberAffix}${key}`;
6823
6831
  return { [key]: { roundName, abbreviatedRoundName } };
6824
6832
  })
6825
6833
  );