autoql-fe-utils 1.0.22 → 1.0.23

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.
@@ -21897,26 +21897,17 @@
21897
21897
  const positiveSumsObject = {};
21898
21898
  const negativeSumsObject = {};
21899
21899
  data.forEach((row) => {
21900
- const label = row[stringColumnIndex];
21900
+ const label = `${row[stringColumnIndex]}`;
21901
21901
  numberColumnIndices.forEach((colIndex) => {
21902
+ var _a;
21902
21903
  const rawValue = row[colIndex];
21903
21904
  let value = Number(rawValue);
21904
21905
  if (isNaN(value)) {
21905
21906
  value = 0;
21906
21907
  }
21907
- if (value >= 0) {
21908
- if (positiveSumsObject[label]) {
21909
- positiveSumsObject[label] += value;
21910
- } else {
21911
- positiveSumsObject[label] = value;
21912
- }
21913
- } else if (value < 0) {
21914
- if (negativeSumsObject[label]) {
21915
- negativeSumsObject[label] -= value;
21916
- } else {
21917
- negativeSumsObject[label] = value;
21918
- }
21919
- }
21908
+ const sumsObject = value >= 0 ? positiveSumsObject : negativeSumsObject;
21909
+ const previousValue = (_a = sumsObject[label]) != null ? _a : 0;
21910
+ sumsObject[label] = previousValue + value;
21920
21911
  });
21921
21912
  });
21922
21913
  let maxValue = getMaxValueFromKeyValueObj(positiveSumsObject);