tods-competition-factory 1.9.0 → 1.9.1

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.
@@ -489,6 +489,11 @@ const extractAttributes = (accessor) => (element) => !accessor || typeof element
489
489
  })) || typeof accessor === "object" && Object.keys(accessor).map((key) => ({
490
490
  [key]: getAccessorValue({ element, accessor: key })?.value
491
491
  })) || (typeof accessor === "string" && getAccessorValue({ element, accessor }))?.value;
492
+ function getDefinedKeys(obj, ignoreValues, ignoreEmptyArrays) {
493
+ return Object.keys(obj).filter(
494
+ (key) => !ignoreValues.includes(obj[key]) && (!ignoreEmptyArrays || (Array.isArray(obj[key]) ? obj[key].length : true))
495
+ );
496
+ }
492
497
  function definedAttributes(obj, ignoreFalse, ignoreEmptyArrays, shallow) {
493
498
  if (typeof obj !== "object" || obj === null)
494
499
  return obj;
@@ -498,9 +503,7 @@ function definedAttributes(obj, ignoreFalse, ignoreEmptyArrays, shallow) {
498
503
  const ignoreValues = ["", void 0, null];
499
504
  if (ignoreFalse)
500
505
  ignoreValues.push(false);
501
- const definedKeys = Object.keys(obj).filter(
502
- (key) => !ignoreValues.includes(obj[key]) && (!ignoreEmptyArrays || (Array.isArray(obj[key]) ? obj[key].length : true))
503
- );
506
+ const definedKeys = getDefinedKeys(obj, ignoreValues, ignoreEmptyArrays);
504
507
  return Object.assign(
505
508
  {},
506
509
  ...definedKeys.map((key) => {