tods-competition-factory 2.2.11 → 2.2.12
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 +6 -6
- package/dist/tods-competition-factory.development.cjs.js +5 -3
- 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 +20 -20
|
@@ -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.12';
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
const SINGLES_MATCHUP = 'SINGLES';
|
|
@@ -2478,8 +2478,10 @@ function getCategoryAgeDetails(params) {
|
|
|
2478
2478
|
let { ageCategoryCode, ageMaxDate, ageMinDate, ageMax, ageMin } = category;
|
|
2479
2479
|
const categoryName = category.categoryName;
|
|
2480
2480
|
let combinedAge;
|
|
2481
|
-
|
|
2482
|
-
|
|
2481
|
+
const isValidCategory = typeMatch([ageCategoryCode, ageMaxDate, ageMinDate, categoryName], 'string') &&
|
|
2482
|
+
allNumeric([ageMax, ageMin]) &&
|
|
2483
|
+
[ageMaxDate, ageMinDate].filter(Boolean).every(isValidDateString);
|
|
2484
|
+
if (!isValidCategory)
|
|
2483
2485
|
return { error: INVALID_CATEGORY };
|
|
2484
2486
|
const consideredDate = params.consideredDate ?? extractDate(new Date().toLocaleDateString('sv'));
|
|
2485
2487
|
if (!isValidDateString(consideredDate))
|