@open-tender/utils 0.1.130 → 0.1.131

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.
@@ -519,7 +519,7 @@ const addItem = (cart, item) => {
519
519
  const itemSignature = (0, exports.makeCartItemSignature)(item);
520
520
  const itemSignatures = cart.map(i => (Object.assign({ signature: (0, exports.makeCartItemSignature)(i) }, i)));
521
521
  const match = itemSignatures.find(i => i.signature === itemSignature);
522
- if (match && match.index) {
522
+ if (match && match.index !== undefined) {
523
523
  const quantity = item.quantity + match.quantity;
524
524
  const newItem = Object.assign(Object.assign({}, item), { quantity });
525
525
  const updated = (0, exports.calcPrices)(newItem);
@@ -492,7 +492,7 @@ export const addItem = (cart, item) => {
492
492
  const itemSignature = makeCartItemSignature(item);
493
493
  const itemSignatures = cart.map(i => (Object.assign({ signature: makeCartItemSignature(i) }, i)));
494
494
  const match = itemSignatures.find(i => i.signature === itemSignature);
495
- if (match && match.index) {
495
+ if (match && match.index !== undefined) {
496
496
  const quantity = item.quantity + match.quantity;
497
497
  const newItem = Object.assign(Object.assign({}, item), { quantity });
498
498
  const updated = calcPrices(newItem);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/utils",
3
- "version": "0.1.130",
3
+ "version": "0.1.131",
4
4
  "description": "A library of utils for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",