tods-competition-factory 1.9.0 → 1.9.2
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 +23 -21
- package/dist/forge/generate.mjs.map +1 -1
- package/dist/forge/query.mjs +9 -17
- package/dist/forge/query.mjs.map +1 -1
- package/dist/forge/transform.mjs +16 -29
- package/dist/forge/transform.mjs.map +1 -1
- package/dist/forge/utilities.mjs +6 -25
- package/dist/forge/utilities.mjs.map +1 -1
- package/dist/index.mjs +80 -73
- package/dist/index.mjs.map +1 -1
- package/dist/tods-competition-factory.development.cjs.js +103 -114
- 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 +10 -10
package/dist/forge/transform.mjs
CHANGED
|
@@ -558,7 +558,6 @@ function handleCaughtError({
|
|
|
558
558
|
const globalState = {
|
|
559
559
|
tournamentFactoryVersion: "0.0.0",
|
|
560
560
|
timers: { default: { elapsedTime: 0 } },
|
|
561
|
-
iterators: { makeDeepCopy: 0 },
|
|
562
561
|
deepCopyAttributes: {
|
|
563
562
|
stringify: [],
|
|
564
563
|
ignore: [],
|
|
@@ -578,9 +577,6 @@ function getDevContext(contextCriteria) {
|
|
|
578
577
|
) && globalState.devContext;
|
|
579
578
|
}
|
|
580
579
|
}
|
|
581
|
-
function setDeepCopyIterations(value) {
|
|
582
|
-
globalState.iterators.makeDeepCopy = value;
|
|
583
|
-
}
|
|
584
580
|
function deepCopyEnabled() {
|
|
585
581
|
return {
|
|
586
582
|
enabled: globalState.deepCopy,
|
|
@@ -800,13 +796,6 @@ function makeDeepCopy(sourceObject, convertExtensions, internalUse, removeExtens
|
|
|
800
796
|
if (!deepCopy?.enabled && !internalUse || typeof sourceObject !== "object" || typeof sourceObject === "function" || sourceObject === null || typeof deepCopy?.threshold === "number" && iteration >= deepCopy.threshold) {
|
|
801
797
|
return sourceObject;
|
|
802
798
|
}
|
|
803
|
-
const devContext = getDevContext({ makeDeepCopy: true });
|
|
804
|
-
if (devContext) {
|
|
805
|
-
setDeepCopyIterations(iteration);
|
|
806
|
-
if (typeof devContext === "object" && (iteration > (devContext.iterationThreshold || 15) || devContext.firstIteration && iteration === 0) && devContext.log && (!devContext.notInternalUse || devContext.notInternalUse && !internalUse)) {
|
|
807
|
-
console.log({ devContext, iteration, internalUse }, sourceObject);
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
799
|
const targetObject = Array.isArray(sourceObject) ? [] : {};
|
|
811
800
|
const sourceObjectKeys = Object.keys(sourceObject).filter(
|
|
812
801
|
(key) => !internalUse || !ignore || Array.isArray(ignore) && !ignore.includes(key) || typeof ignore === "function" && !ignore(key)
|
|
@@ -918,6 +907,11 @@ const extractAttributes = (accessor) => (element) => !accessor || typeof element
|
|
|
918
907
|
})) || typeof accessor === "object" && Object.keys(accessor).map((key) => ({
|
|
919
908
|
[key]: getAccessorValue({ element, accessor: key })?.value
|
|
920
909
|
})) || (typeof accessor === "string" && getAccessorValue({ element, accessor }))?.value;
|
|
910
|
+
function getDefinedKeys(obj, ignoreValues, ignoreEmptyArrays) {
|
|
911
|
+
return Object.keys(obj).filter(
|
|
912
|
+
(key) => !ignoreValues.includes(obj[key]) && (!ignoreEmptyArrays || (Array.isArray(obj[key]) ? obj[key].length : true))
|
|
913
|
+
);
|
|
914
|
+
}
|
|
921
915
|
function definedAttributes(obj, ignoreFalse, ignoreEmptyArrays, shallow) {
|
|
922
916
|
if (typeof obj !== "object" || obj === null)
|
|
923
917
|
return obj;
|
|
@@ -927,9 +921,7 @@ function definedAttributes(obj, ignoreFalse, ignoreEmptyArrays, shallow) {
|
|
|
927
921
|
const ignoreValues = ["", void 0, null];
|
|
928
922
|
if (ignoreFalse)
|
|
929
923
|
ignoreValues.push(false);
|
|
930
|
-
const definedKeys =
|
|
931
|
-
(key) => !ignoreValues.includes(obj[key]) && (!ignoreEmptyArrays || (Array.isArray(obj[key]) ? obj[key].length : true))
|
|
932
|
-
);
|
|
924
|
+
const definedKeys = getDefinedKeys(obj, ignoreValues, ignoreEmptyArrays);
|
|
933
925
|
return Object.assign(
|
|
934
926
|
{},
|
|
935
927
|
...definedKeys.map((key) => {
|
|
@@ -11733,11 +11725,10 @@ function modifyMatchUpScore({
|
|
|
11733
11725
|
}
|
|
11734
11726
|
if (Array.isArray(defaultedProcessCodes) && inContextMatchUp && !inContextMatchUp.sides?.every(({ participantId }) => participantId)) {
|
|
11735
11727
|
if (matchUpStatus === DEFAULTED) {
|
|
11736
|
-
|
|
11737
|
-
matchUp.processCodes
|
|
11738
|
-
|
|
11739
|
-
|
|
11740
|
-
}
|
|
11728
|
+
matchUp.processCodes = unique([
|
|
11729
|
+
...matchUp.processCodes ?? [],
|
|
11730
|
+
...defaultedProcessCodes
|
|
11731
|
+
]);
|
|
11741
11732
|
} else {
|
|
11742
11733
|
for (const processCode of defaultedProcessCodes || []) {
|
|
11743
11734
|
const codeIndex = processCode && matchUp?.processCodes?.lastIndexOf(processCode);
|
|
@@ -13049,18 +13040,14 @@ function conditionallyAdvanceDrawPosition(params) {
|
|
|
13049
13040
|
} else {
|
|
13050
13041
|
sourceSideNumber = 2;
|
|
13051
13042
|
}
|
|
13052
|
-
} else {
|
|
13053
|
-
if (targetMatchUp.
|
|
13054
|
-
|
|
13055
|
-
sourceSideNumber = 2;
|
|
13056
|
-
} else {
|
|
13057
|
-
sourceSideNumber = 1;
|
|
13058
|
-
}
|
|
13043
|
+
} else if (targetMatchUp.feedRound) {
|
|
13044
|
+
if (sourceMatchUp.structureId === targetMatchUp.structureId) {
|
|
13045
|
+
sourceSideNumber = 2;
|
|
13059
13046
|
} else {
|
|
13060
|
-
|
|
13061
|
-
sourceSideNumber = 3 - walkoverWinningSide;
|
|
13047
|
+
sourceSideNumber = 1;
|
|
13062
13048
|
}
|
|
13063
|
-
}
|
|
13049
|
+
} else if (walkoverWinningSide)
|
|
13050
|
+
sourceSideNumber = 3 - walkoverWinningSide;
|
|
13064
13051
|
}
|
|
13065
13052
|
const sourceMatchUpStatus = params.matchUpStatus;
|
|
13066
13053
|
const pairedMatchUpStatus = pairedPreviousMatchUp?.matchUpStatus;
|