lazywait-calcs 1.1.0 → 1.1.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.
package/lib/cjs/Calcs.js CHANGED
@@ -208,11 +208,12 @@ function Deliveries(order_deliveries) {
208
208
  let sum = 0;
209
209
  if (order_deliveries) {
210
210
  (order_deliveries || []).forEach((d) => {
211
- if (d.delivery_type === 'RADIUS') {
212
- sum += (d.delivery_fee || 0) * (d.delivery_radius || 1);
211
+ var _a, _b;
212
+ if ((d === null || d === void 0 ? void 0 : d.delivery_type) === 'RADIUS') {
213
+ sum += ((_a = d === null || d === void 0 ? void 0 : d.delivery_fee) !== null && _a !== void 0 ? _a : 0) * (d.delivery_radius || 1);
213
214
  }
214
215
  else {
215
- sum += d.delivery_fee || 0;
216
+ sum += (_b = d === null || d === void 0 ? void 0 : d.delivery_fee) !== null && _b !== void 0 ? _b : 0;
216
217
  }
217
218
  });
218
219
  }
package/lib/esm/Calcs.js CHANGED
@@ -183,11 +183,11 @@ export function Deliveries(order_deliveries) {
183
183
  let sum = 0;
184
184
  if (order_deliveries) {
185
185
  (order_deliveries || []).forEach((d) => {
186
- if (d.delivery_type === 'RADIUS') {
187
- sum += (d.delivery_fee || 0) * (d.delivery_radius || 1);
186
+ if (d?.delivery_type === 'RADIUS') {
187
+ sum += (d?.delivery_fee ?? 0) * (d.delivery_radius || 1);
188
188
  }
189
189
  else {
190
- sum += d.delivery_fee || 0;
190
+ sum += d?.delivery_fee ?? 0;
191
191
  }
192
192
  });
193
193
  }
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lazywait-calcs",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "An npm package for all calculations needed in LazyWait projects.",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "repository": "https://github.com/CloudAppsLLC/Calcs.git",