@etsoo/appscript 1.4.52 → 1.4.53

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.
@@ -389,7 +389,8 @@ class ShoppingCart {
389
389
  price,
390
390
  qty,
391
391
  subtotal: price * qty,
392
- discount: 0
392
+ discount: 0,
393
+ promotions: Array()
393
394
  };
394
395
  this.addItem(newItem);
395
396
  }
@@ -386,7 +386,8 @@ export class ShoppingCart {
386
386
  price,
387
387
  qty,
388
388
  subtotal: price * qty,
389
- discount: 0
389
+ discount: 0,
390
+ promotions: Array()
390
391
  };
391
392
  this.addItem(newItem);
392
393
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.4.52",
3
+ "version": "1.4.53",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -353,7 +353,7 @@ export class ShoppingCart<T extends ShoppingCartItem> {
353
353
  * Cached prices
354
354
  * 缓存的价格
355
355
  */
356
- private prices: Record<T['id'], number> = {} as any;
356
+ private prices = <Record<T['id'], number>>{};
357
357
 
358
358
  /**
359
359
  * Onchange callback
@@ -462,7 +462,7 @@ export class ShoppingCart<T extends ShoppingCartItem> {
462
462
  clear(keepOwner?: boolean) {
463
463
  this.items.length = 0;
464
464
  this.promotions.length = 0;
465
- this.prices = {} as any;
465
+ this.prices = <Record<T['id'], number>>{};
466
466
 
467
467
  if (keepOwner) {
468
468
  this.save();
@@ -604,7 +604,8 @@ export class ShoppingCart<T extends ShoppingCartItem> {
604
604
  price,
605
605
  qty,
606
606
  subtotal: price * qty,
607
- discount: 0
607
+ discount: 0,
608
+ promotions: Array<ShoppingPromotion>()
608
609
  } as T;
609
610
  this.addItem(newItem);
610
611
  }