@infrab4a/connect-angular 3.8.3-beta.0 → 3.9.0-beta.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.
@@ -819,13 +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) { return items
823
- ? items.reduce(function (cart, item) {
824
- var _h;
825
- var _a;
826
- 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)));
827
- }, {})
828
- : []; };
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
+ }, {}); };
829
827
  this.buildLineItem = function (_h) {
830
828
  var checkout = _h.checkout, item = _h.item, quantity = _h.quantity;
831
829
  return __awaiter(_this, void 0, void 0, function () {
@@ -1007,7 +1005,7 @@
1007
1005
  return __generator(this, function (_o) {
1008
1006
  switch (_o.label) {
1009
1007
  case 0:
1010
- notGiftItems = checkout.lineItems ? checkout.lineItems.filter(function (item) { return !item.isGift; }) : [];
1008
+ notGiftItems = checkout.lineItems.filter(function (item) { return !item.isGift; });
1011
1009
  if (!notGiftItems.length)
1012
1010
  return [2 /*return*/, Object.assign(Object.assign({}, checkout), { lineItems: [] })];
1013
1011
  cartTotal = notGiftItems.reduce(function (a, b) { return a + b.pricePaid * b.quantity; }, 0);