@infrab4a/connect-angular 3.7.8-beta.0 → 3.7.8-beta.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.
@@ -819,14 +819,11 @@
819
819
  .updateCheckoutLineItems(checkoutLoaded)
820
820
  .pipe(operators.map(function (updatedCheckout) { return _this.generateCartObject(updatedCheckout.lineItems); }));
821
821
  })); };
822
- this.generateCartObject = function (items) {
823
- var cart = {};
824
- items === null || items === void 0 ? void 0 : items.forEach(function (item) {
825
- var _a;
826
- return (cart[item.sku] = i3.LineItem.toInstance(Object.assign(Object.assign({}, (cart[item.sku] || item)), { quantity: (((_a = cart[item.sku]) === null || _a === void 0 ? void 0 : _a.quantity) || 0) + (item.quantity ? item.quantity : 1) })));
827
- });
828
- return cart;
829
- };
822
+ this.generateCartObject = function (items) { return items.reduce(function (cart, item) {
823
+ var _h;
824
+ var _a;
825
+ return (Object.assign(Object.assign({}, cart), (_h = {}, _h[item.id] = i3.LineItem.toInstance(Object.assign(Object.assign({}, (cart[item.id] || item)), { quantity: (((_a = cart[item.id]) === null || _a === void 0 ? void 0 : _a.quantity) || 0) + (item.quantity ? item.quantity : 1) })), _h)));
826
+ }, {}); };
830
827
  this.buildLineItem = function (_h) {
831
828
  var checkout = _h.checkout, item = _h.item, quantity = _h.quantity;
832
829
  return __awaiter(_this, void 0, void 0, function () {