@orderingstack/front-hooks 5.0.5 → 5.0.7

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/index.es.js CHANGED
@@ -1492,7 +1492,17 @@ function qn(e) {
1492
1492
  }
1493
1493
  return t;
1494
1494
  }, {}), r.forEach((t) => {
1495
- t.total = t.total.toFixed(2);
1495
+ var n;
1496
+ t.total = Number(t.total).toFixed(2), t.discounts && ((n = t.discounts) == null ? void 0 : n.length) > 0 && (t.groupedDiscounts = [], t.discounts.forEach((a) => {
1497
+ var s, o;
1498
+ const i = a.name ? (s = t.groupedDiscounts) == null ? void 0 : s.find(
1499
+ (l) => l.name === a.name
1500
+ ) : void 0;
1501
+ i ? i.value = i.value + Number(a.discountPrice) : (o = t.groupedDiscounts) == null || o.push({
1502
+ name: a.name,
1503
+ value: Number(a.discountPrice)
1504
+ });
1505
+ }));
1496
1506
  }), r;
1497
1507
  }
1498
1508
  function Kv(e) {