tods-competition-factory 1.8.43 → 1.8.45
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 +47 -23
- package/dist/forge/generate.mjs.map +1 -1
- package/dist/forge/query.d.ts +12 -11
- package/dist/forge/query.mjs +3 -3
- package/dist/forge/query.mjs.map +1 -1
- package/dist/forge/transform.mjs +32 -21
- package/dist/forge/transform.mjs.map +1 -1
- package/dist/index.mjs +134 -98
- package/dist/index.mjs.map +1 -1
- package/dist/tods-competition-factory.development.cjs.js +163 -145
- 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 +6 -6
package/dist/forge/query.d.ts
CHANGED
|
@@ -2138,17 +2138,18 @@ type RoundMatchUpsResult = {
|
|
|
2138
2138
|
};
|
|
2139
2139
|
declare function getRoundMatchUps({ matchUps, interpolate, }: GetRoundMatchUpsArgs): RoundMatchUpsResult;
|
|
2140
2140
|
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2141
|
+
type GetSeedsCountArgs = {
|
|
2142
|
+
policyDefinitions?: PolicyDefinitions;
|
|
2143
|
+
requireParticipantCount?: boolean;
|
|
2144
|
+
drawSizeProgression?: boolean;
|
|
2145
|
+
tournamentRecord?: Tournament;
|
|
2146
|
+
drawDefinition?: DrawDefinition;
|
|
2147
|
+
participantsCount?: number;
|
|
2148
|
+
participantCount?: number;
|
|
2149
|
+
drawSize?: any;
|
|
2150
|
+
event?: Event;
|
|
2151
|
+
};
|
|
2152
|
+
declare function getSeedsCount(params: GetSeedsCountArgs): ResultType & {
|
|
2152
2153
|
seedsCount?: number;
|
|
2153
2154
|
};
|
|
2154
2155
|
|
package/dist/forge/query.mjs
CHANGED
|
@@ -10750,9 +10750,9 @@ function getSeedsCount(params) {
|
|
|
10750
10750
|
}
|
|
10751
10751
|
}
|
|
10752
10752
|
const consideredParticipantCount = requireParticipantCount && participantsCount || drawSize;
|
|
10753
|
-
if (consideredParticipantCount > drawSize)
|
|
10753
|
+
if (consideredParticipantCount && consideredParticipantCount > drawSize)
|
|
10754
10754
|
return { error: PARTICIPANT_COUNT_EXCEEDS_DRAW_SIZE };
|
|
10755
|
-
const policy = policyDefinitions[POLICY_TYPE_SEEDING];
|
|
10755
|
+
const policy = policyDefinitions?.[POLICY_TYPE_SEEDING];
|
|
10756
10756
|
if (!policy)
|
|
10757
10757
|
return { error: INVALID_POLICY_DEFINITION };
|
|
10758
10758
|
const seedsCountThresholds = policy.seedsCountThresholds;
|
|
@@ -10764,7 +10764,7 @@ function getSeedsCount(params) {
|
|
|
10764
10764
|
return drawSizeProgression ? threshold.drawSize <= drawSize : drawSize === threshold.drawSize;
|
|
10765
10765
|
});
|
|
10766
10766
|
const seedsCount = relevantThresholds.reduce((seedsCount2, threshold) => {
|
|
10767
|
-
return participantsCount >= threshold.minimumParticipantCount ? threshold.seedsCount : seedsCount2;
|
|
10767
|
+
return participantsCount && participantsCount >= threshold.minimumParticipantCount ? threshold.seedsCount : seedsCount2;
|
|
10768
10768
|
}, 0);
|
|
10769
10769
|
return { seedsCount };
|
|
10770
10770
|
}
|