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/query.mjs
CHANGED
|
@@ -454,7 +454,6 @@ function handleCaughtError({
|
|
|
454
454
|
const globalState = {
|
|
455
455
|
tournamentFactoryVersion: "0.0.0",
|
|
456
456
|
timers: { default: { elapsedTime: 0 } },
|
|
457
|
-
iterators: { makeDeepCopy: 0 },
|
|
458
457
|
deepCopyAttributes: {
|
|
459
458
|
stringify: [],
|
|
460
459
|
ignore: [],
|
|
@@ -474,9 +473,6 @@ function getDevContext(contextCriteria) {
|
|
|
474
473
|
) && globalState.devContext;
|
|
475
474
|
}
|
|
476
475
|
}
|
|
477
|
-
function setDeepCopyIterations(value) {
|
|
478
|
-
globalState.iterators.makeDeepCopy = value;
|
|
479
|
-
}
|
|
480
476
|
function deepCopyEnabled() {
|
|
481
477
|
return {
|
|
482
478
|
enabled: globalState.deepCopy,
|
|
@@ -635,13 +631,6 @@ function makeDeepCopy(sourceObject, convertExtensions, internalUse, removeExtens
|
|
|
635
631
|
if (!deepCopy?.enabled && !internalUse || typeof sourceObject !== "object" || typeof sourceObject === "function" || sourceObject === null || typeof deepCopy?.threshold === "number" && iteration >= deepCopy.threshold) {
|
|
636
632
|
return sourceObject;
|
|
637
633
|
}
|
|
638
|
-
const devContext = getDevContext({ makeDeepCopy: true });
|
|
639
|
-
if (devContext) {
|
|
640
|
-
setDeepCopyIterations(iteration);
|
|
641
|
-
if (typeof devContext === "object" && (iteration > (devContext.iterationThreshold || 15) || devContext.firstIteration && iteration === 0) && devContext.log && (!devContext.notInternalUse || devContext.notInternalUse && !internalUse)) {
|
|
642
|
-
console.log({ devContext, iteration, internalUse }, sourceObject);
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
634
|
const targetObject = Array.isArray(sourceObject) ? [] : {};
|
|
646
635
|
const sourceObjectKeys = Object.keys(sourceObject).filter(
|
|
647
636
|
(key) => !internalUse || !ignore || Array.isArray(ignore) && !ignore.includes(key) || typeof ignore === "function" && !ignore(key)
|
|
@@ -750,6 +739,11 @@ const extractAttributes = (accessor) => (element) => !accessor || typeof element
|
|
|
750
739
|
})) || typeof accessor === "object" && Object.keys(accessor).map((key) => ({
|
|
751
740
|
[key]: getAccessorValue({ element, accessor: key })?.value
|
|
752
741
|
})) || (typeof accessor === "string" && getAccessorValue({ element, accessor }))?.value;
|
|
742
|
+
function getDefinedKeys(obj, ignoreValues, ignoreEmptyArrays) {
|
|
743
|
+
return Object.keys(obj).filter(
|
|
744
|
+
(key) => !ignoreValues.includes(obj[key]) && (!ignoreEmptyArrays || (Array.isArray(obj[key]) ? obj[key].length : true))
|
|
745
|
+
);
|
|
746
|
+
}
|
|
753
747
|
function definedAttributes(obj, ignoreFalse, ignoreEmptyArrays, shallow) {
|
|
754
748
|
if (typeof obj !== "object" || obj === null)
|
|
755
749
|
return obj;
|
|
@@ -759,9 +753,7 @@ function definedAttributes(obj, ignoreFalse, ignoreEmptyArrays, shallow) {
|
|
|
759
753
|
const ignoreValues = ["", void 0, null];
|
|
760
754
|
if (ignoreFalse)
|
|
761
755
|
ignoreValues.push(false);
|
|
762
|
-
const definedKeys =
|
|
763
|
-
(key) => !ignoreValues.includes(obj[key]) && (!ignoreEmptyArrays || (Array.isArray(obj[key]) ? obj[key].length : true))
|
|
764
|
-
);
|
|
756
|
+
const definedKeys = getDefinedKeys(obj, ignoreValues, ignoreEmptyArrays);
|
|
765
757
|
return Object.assign(
|
|
766
758
|
{},
|
|
767
759
|
...definedKeys.map((key) => {
|
|
@@ -14646,12 +14638,12 @@ function positionActions$1(params) {
|
|
|
14646
14638
|
const isActiveDrawPosition = activeDrawPositions.includes(drawPosition);
|
|
14647
14639
|
if (actionsDisabled)
|
|
14648
14640
|
return {
|
|
14641
|
+
hasPositionAssigned: !!positionAssignment,
|
|
14649
14642
|
info: "Actions Disabled for structure",
|
|
14650
|
-
isByePosition,
|
|
14651
14643
|
isActiveDrawPosition,
|
|
14652
14644
|
isDrawPosition: true,
|
|
14653
|
-
|
|
14654
|
-
|
|
14645
|
+
validActions: [],
|
|
14646
|
+
isByePosition
|
|
14655
14647
|
};
|
|
14656
14648
|
if (isAvailableAction({ policyActions, action: ASSIGN_PARTICIPANT }) && !isActiveDrawPosition && positionAssignments && !disablePlacementActions && (!positionAssignment || isByePosition)) {
|
|
14657
14649
|
const { validAssignmentActions } = getValidAssignmentActions({
|