@popmenu/table 0.97.0 → 0.99.0

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/build/index.es.js CHANGED
@@ -1452,10 +1452,17 @@ var useStagedColumnFilters = function (selectedColumnFilters) {
1452
1452
  return selectedColumnFilters.reduce(function (acc, _a) {
1453
1453
  var id = _a.id, value = _a.value;
1454
1454
  if (acc.has(id)) {
1455
- acc.get(id).push(value);
1455
+ var existingValue = acc.get(id);
1456
+ // If the existing value is a string, convert it to an array and add the new value
1457
+ if (typeof existingValue === 'string') {
1458
+ acc.set(id, [existingValue, value]);
1459
+ }
1460
+ else {
1461
+ existingValue.push(value);
1462
+ }
1456
1463
  }
1457
1464
  else {
1458
- acc.set(id, [value]);
1465
+ acc.set(id, value);
1459
1466
  }
1460
1467
  return acc;
1461
1468
  }, new Map());