@open-tender/cloud 0.4.1 → 0.4.4

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.
@@ -8,7 +8,7 @@ const types_1 = require("./types");
8
8
  const utils_1 = require("@open-tender/utils");
9
9
  const makeAllergenLookup = (data) => {
10
10
  return data.reduce((obj, i) => {
11
- const imageMap = (0, utils_1.makeImageMap)(i.images);
11
+ const imageMap = i.images ? (0, utils_1.makeImageMap)(i.images) : {};
12
12
  const imageUrl = imageMap.SMALL_IMAGE || imageMap.APP_IMAGE || imageMap.LARGE_IMAGE || '';
13
13
  const tag = Object.assign(Object.assign({}, i), { imageUrl });
14
14
  return Object.assign(Object.assign({}, obj), { [i.name]: tag });
@@ -8,7 +8,7 @@ const types_1 = require("./types");
8
8
  const utils_1 = require("@open-tender/utils");
9
9
  const makeTagLookup = (data) => {
10
10
  return data.reduce((obj, i) => {
11
- const imageMap = (0, utils_1.makeImageMap)(i.images);
11
+ const imageMap = i.images ? (0, utils_1.makeImageMap)(i.images) : {};
12
12
  const imageUrl = imageMap.SMALL_IMAGE || imageMap.APP_IMAGE || imageMap.LARGE_IMAGE || '';
13
13
  const tag = Object.assign(Object.assign({}, i), { imageUrl });
14
14
  return Object.assign(Object.assign({}, obj), { [i.name]: tag });
@@ -4,7 +4,7 @@ import { ReducerType } from './types';
4
4
  import { makeImageMap } from '@open-tender/utils';
5
5
  const makeAllergenLookup = (data) => {
6
6
  return data.reduce((obj, i) => {
7
- const imageMap = makeImageMap(i.images);
7
+ const imageMap = i.images ? makeImageMap(i.images) : {};
8
8
  const imageUrl = imageMap.SMALL_IMAGE || imageMap.APP_IMAGE || imageMap.LARGE_IMAGE || '';
9
9
  const tag = Object.assign(Object.assign({}, i), { imageUrl });
10
10
  return Object.assign(Object.assign({}, obj), { [i.name]: tag });
@@ -4,7 +4,7 @@ import { ReducerType } from './types';
4
4
  import { makeImageMap } from '@open-tender/utils';
5
5
  const makeTagLookup = (data) => {
6
6
  return data.reduce((obj, i) => {
7
- const imageMap = makeImageMap(i.images);
7
+ const imageMap = i.images ? makeImageMap(i.images) : {};
8
8
  const imageUrl = imageMap.SMALL_IMAGE || imageMap.APP_IMAGE || imageMap.LARGE_IMAGE || '';
9
9
  const tag = Object.assign(Object.assign({}, i), { imageUrl });
10
10
  return Object.assign(Object.assign({}, obj), { [i.name]: tag });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.4.1",
3
+ "version": "0.4.4",
4
4
  "description": "A library of hooks, reducers, utility functions, and types 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",
@@ -49,9 +49,13 @@
49
49
  "typescript": "^4.8.2"
50
50
  },
51
51
  "peerDependencies": {
52
- "@open-tender/types": "^0.3.19",
53
- "@open-tender/utils": "^0.3.10",
52
+ "@open-tender/types": "^0.4.9",
53
+ "@open-tender/utils": "^0.4.6",
54
54
  "@reduxjs/toolkit": "^1.8.5",
55
55
  "react": "^18.2.0"
56
+ },
57
+ "dependencies": {
58
+ "@open-tender/types": "^0.4.9",
59
+ "@open-tender/utils": "^0.4.6"
56
60
  }
57
61
  }