tods-competition-factory 2.2.46 → 2.2.48
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/index.mjs +3 -3
- package/dist/tods-competition-factory.development.cjs.js +9 -12
- 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 +4 -4
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
function factoryVersion() {
|
|
6
|
-
return '2.2.
|
|
6
|
+
return '2.2.48';
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
const SINGLES_MATCHUP = 'SINGLES';
|
|
@@ -32384,12 +32384,10 @@ function validateSetScore(set, matchUpFormat, isDecidingSet, allowIncomplete) {
|
|
|
32384
32384
|
if (side1Score === 0 && side2Score === 0) {
|
|
32385
32385
|
return { isValid: false, error: 'Timed set requires at least one side to have scored' };
|
|
32386
32386
|
}
|
|
32387
|
-
if (setFormat.based === 'P') {
|
|
32388
|
-
|
|
32389
|
-
|
|
32390
|
-
|
|
32391
|
-
return { isValid: false, error: 'Tied timed set requires tiebreak' };
|
|
32392
|
-
}
|
|
32387
|
+
if (setFormat.based === 'P' && side1Score === side2Score && side1Score > 0 && setFormat.tiebreakFormat) {
|
|
32388
|
+
const hasTiebreak = set.side1TiebreakScore !== undefined || set.side2TiebreakScore !== undefined;
|
|
32389
|
+
if (!hasTiebreak) {
|
|
32390
|
+
return { isValid: false, error: 'Tied timed set requires tiebreak' };
|
|
32393
32391
|
}
|
|
32394
32392
|
}
|
|
32395
32393
|
}
|
|
@@ -32404,7 +32402,7 @@ function validateSetScore(set, matchUpFormat, isDecidingSet, allowIncomplete) {
|
|
|
32404
32402
|
const loserScore = Math.min(side1Score, side2Score);
|
|
32405
32403
|
const scoreDiff = winnerScore - loserScore;
|
|
32406
32404
|
if (isTiebreakOnlyFormat) {
|
|
32407
|
-
const NoAD = setFormat.tiebreakSet?.NoAD ?? false;
|
|
32405
|
+
const NoAD = set.NoAD ?? setFormat.tiebreakSet?.NoAD ?? false;
|
|
32408
32406
|
return validateTiebreakOnlySet(winnerScore, loserScore, scoreDiff, tiebreakSetTo, allowIncomplete ?? false, NoAD);
|
|
32409
32407
|
}
|
|
32410
32408
|
const hasExplicitTiebreak = side1TiebreakScore !== undefined || side2TiebreakScore !== undefined;
|
|
@@ -47346,7 +47344,7 @@ function generateScoreForWinnerOrder(neutralParsedSets, inferredWinningSide, mat
|
|
|
47346
47344
|
};
|
|
47347
47345
|
}
|
|
47348
47346
|
function generateOutcomeFromScoreString(params) {
|
|
47349
|
-
const { matchUpFormat, matchUpStatus, winningSide, scoreString, setTBlast } = params;
|
|
47347
|
+
const { matchUpFormat, matchUpStatus, winningSide, scoreString, setTBlast, preserveSideOrder = false } = params;
|
|
47350
47348
|
if (!scoreString)
|
|
47351
47349
|
return {
|
|
47352
47350
|
outcome: {
|
|
@@ -47362,7 +47360,7 @@ function generateOutcomeFromScoreString(params) {
|
|
|
47362
47360
|
const inferredWinningSide = inferWinningSide(winningSide, matchUpFormat, neutralParsedSets);
|
|
47363
47361
|
const parsedFormat = parse(matchUpFormat);
|
|
47364
47362
|
const isAggregateScoring = parsedFormat?.setFormat?.based === 'A' || parsedFormat?.finalSetFormat?.based === 'A';
|
|
47365
|
-
const score = isBracketNotation || isAggregateScoring
|
|
47363
|
+
const score = preserveSideOrder || isBracketNotation || isAggregateScoring
|
|
47366
47364
|
? generateScoreForSideOrder(scoreString, matchUpFormat, setTBlast)
|
|
47367
47365
|
: generateScoreForWinnerOrder(neutralParsedSets, inferredWinningSide, matchUpFormat, setTBlast);
|
|
47368
47366
|
return definedAttributes({
|
|
@@ -52051,8 +52049,7 @@ function processLeagueProfiles(params) {
|
|
|
52051
52049
|
homeVenueIds,
|
|
52052
52050
|
};
|
|
52053
52051
|
homeVenueIds.forEach((venueId) => !venueIds.includes(venueId) && venueIds.push(venueId));
|
|
52054
|
-
allUniqueParticipantIds.push(...individualParticipantIds);
|
|
52055
|
-
allUniqueParticipantIds.push(teamParticipantId);
|
|
52052
|
+
allUniqueParticipantIds.push(...individualParticipantIds, teamParticipantId);
|
|
52056
52053
|
const result = addParticipants({
|
|
52057
52054
|
participants: [teamParticipant, ...participants],
|
|
52058
52055
|
tournamentRecord,
|