@open-tender/utils 0.4.27 → 0.4.29
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/cjs/utils/cart.js
CHANGED
|
@@ -259,8 +259,11 @@ const makeOrderItemGroups = (optionGroups, isEdit, soldOut = []) => {
|
|
|
259
259
|
return groups;
|
|
260
260
|
};
|
|
261
261
|
const makeOrderItem = (item, isEdit, soldOut = [], simpleItem, hasPoints = false) => {
|
|
262
|
+
var _a;
|
|
262
263
|
const groups = makeOrderItemGroups(item.option_groups, isEdit, soldOut);
|
|
263
|
-
const cals = item.nutritional_info ?
|
|
264
|
+
const cals = ((_a = item.nutritional_info) === null || _a === void 0 ? void 0 : _a.calories)
|
|
265
|
+
? parseInt(item.nutritional_info.calories.toString())
|
|
266
|
+
: null;
|
|
264
267
|
const isSoldOut = (0, exports.checkSoldOut)(item.id, item.suspend_until, soldOut);
|
|
265
268
|
const orderItem = {
|
|
266
269
|
allergens: (0, helpers_1.convertStringToArray)(item.allergens),
|
package/dist/esm/utils/cart.js
CHANGED
|
@@ -244,8 +244,11 @@ const makeOrderItemGroups = (optionGroups, isEdit, soldOut = []) => {
|
|
|
244
244
|
return groups;
|
|
245
245
|
};
|
|
246
246
|
export const makeOrderItem = (item, isEdit, soldOut = [], simpleItem, hasPoints = false) => {
|
|
247
|
+
var _a;
|
|
247
248
|
const groups = makeOrderItemGroups(item.option_groups, isEdit, soldOut);
|
|
248
|
-
const cals = item.nutritional_info ?
|
|
249
|
+
const cals = ((_a = item.nutritional_info) === null || _a === void 0 ? void 0 : _a.calories)
|
|
250
|
+
? parseInt(item.nutritional_info.calories.toString())
|
|
251
|
+
: null;
|
|
249
252
|
const isSoldOut = checkSoldOut(item.id, item.suspend_until, soldOut);
|
|
250
253
|
const orderItem = {
|
|
251
254
|
allergens: convertStringToArray(item.allergens),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/utils",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.29",
|
|
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",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"typescript": "^4.8.2"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@open-tender/types": "^0.4.
|
|
60
|
+
"@open-tender/types": "^0.4.51",
|
|
61
61
|
"@reduxjs/toolkit": "^1.8.5",
|
|
62
62
|
"react": "^18.2.0"
|
|
63
63
|
},
|