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.
- package/dist/forge/generate.mjs +19 -6
- package/dist/forge/generate.mjs.map +1 -1
- package/dist/forge/query.mjs +12 -4
- package/dist/forge/query.mjs.map +1 -1
- package/dist/forge/transform.mjs +14 -6
- package/dist/forge/transform.mjs.map +1 -1
- package/dist/forge/utilities.mjs.map +1 -1
- package/dist/index.mjs +192 -54
- package/dist/index.mjs.map +1 -1
- package/dist/tods-competition-factory.development.cjs.js +196 -52
- package/dist/tods-competition-factory.development.cjs.js.map +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js.map +1 -1
- package/package.json +3 -3
package/dist/forge/transform.mjs
CHANGED
|
@@ -3217,7 +3217,8 @@ function getCollectionPositionMatchUps({ matchUps }) {
|
|
|
3217
3217
|
|
|
3218
3218
|
const add = (a, b) => (a || 0) + (b || 0);
|
|
3219
3219
|
function getBand(spread, bandProfiles) {
|
|
3220
|
-
|
|
3220
|
+
const spreadValue = Array.isArray(spread) ? spread[0] : spread;
|
|
3221
|
+
return isNaN(spreadValue) && WALKOVER || spreadValue <= bandProfiles[DECISIVE] && DECISIVE || spreadValue <= bandProfiles[ROUTINE] && ROUTINE || COMPETITIVE;
|
|
3221
3222
|
}
|
|
3222
3223
|
function getScoreComponents({ score }) {
|
|
3223
3224
|
const sets = score?.sets || [];
|
|
@@ -3287,7 +3288,8 @@ function getMatchUpCompetitiveProfile({
|
|
|
3287
3288
|
const scoreComponents = getScoreComponents({ score });
|
|
3288
3289
|
const spread = pctSpread([scoreComponents]);
|
|
3289
3290
|
const competitiveness = getBand(spread, bandProfiles);
|
|
3290
|
-
|
|
3291
|
+
const pctSpreadValue = Array.isArray(spread) ? spread[0] : spread;
|
|
3292
|
+
return { ...SUCCESS, competitiveness, pctSpread: pctSpreadValue };
|
|
3291
3293
|
}
|
|
3292
3294
|
|
|
3293
3295
|
function findMatchupFormatAverageTimes(params) {
|
|
@@ -5570,6 +5572,9 @@ function isAdHoc({ drawDefinition, structure }) {
|
|
|
5570
5572
|
const POLICY_ROUND_NAMING_DEFAULT = {
|
|
5571
5573
|
[POLICY_TYPE_ROUND_NAMING]: {
|
|
5572
5574
|
policyName: "Round Naming Default",
|
|
5575
|
+
namingConventions: {
|
|
5576
|
+
round: "Round"
|
|
5577
|
+
},
|
|
5573
5578
|
abbreviatedRoundNamingMap: {
|
|
5574
5579
|
// key is matchUpsCount for the round
|
|
5575
5580
|
1: "F",
|
|
@@ -5609,6 +5614,9 @@ function getRoundContextProfile({
|
|
|
5609
5614
|
const roundNamingMap = roundNamingPolicy?.roundNamingMap || defaultRoundNamingPolicy.roundNamingMap || {};
|
|
5610
5615
|
const abbreviatedRoundNamingMap = roundNamingPolicy?.abbreviatedRoundNamingMap || defaultRoundNamingPolicy.abbreviatedRoundNamingMap || {};
|
|
5611
5616
|
const roundNamePrefix = roundNamingPolicy?.affixes || defaultRoundNamingPolicy.affixes;
|
|
5617
|
+
const roundNumberAffix = roundNamePrefix.roundNumber || defaultRoundNamingPolicy.affixes.roundNumber;
|
|
5618
|
+
const namingConventions = roundNamingPolicy?.namingConventions || defaultRoundNamingPolicy.namingConventions;
|
|
5619
|
+
const roundNameFallback = namingConventions.round;
|
|
5612
5620
|
const stageInitial = stage && stage !== MAIN && stage[0];
|
|
5613
5621
|
const stageConstants = roundNamingPolicy?.stageConstants;
|
|
5614
5622
|
const stageConstant = stage && stageConstants?.[stage] || stageInitial;
|
|
@@ -5617,8 +5625,8 @@ function getRoundContextProfile({
|
|
|
5617
5625
|
Object.assign(
|
|
5618
5626
|
roundNamingProfile,
|
|
5619
5627
|
...roundProfileKeys.map((key) => {
|
|
5620
|
-
const roundName =
|
|
5621
|
-
const abbreviatedRoundName =
|
|
5628
|
+
const roundName = `${roundNameFallback} ${key}`;
|
|
5629
|
+
const abbreviatedRoundName = `${roundNumberAffix}${key}`;
|
|
5622
5630
|
return { [key]: { roundName, abbreviatedRoundName } };
|
|
5623
5631
|
})
|
|
5624
5632
|
);
|
|
@@ -16537,8 +16545,8 @@ function modifyMatchUpFormatTiming({
|
|
|
16537
16545
|
recoveryTimes
|
|
16538
16546
|
});
|
|
16539
16547
|
addTournamentExtension({
|
|
16540
|
-
|
|
16541
|
-
|
|
16548
|
+
extension: { name, value },
|
|
16549
|
+
tournamentRecord
|
|
16542
16550
|
});
|
|
16543
16551
|
}
|
|
16544
16552
|
return { ...SUCCESS };
|