orc-shared 5.8.0-dev.17 → 5.8.0-dev.19

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.
@@ -39,7 +39,7 @@ var Badge = function Badge(_ref) {
39
39
  badge = _ref.badge,
40
40
  props = _objectWithoutProperties(_ref, _excluded);
41
41
  var classes = useStyles();
42
- var classProp = !!((_props$classProp = props.classProp) != null && _props$classProp.badge) ? props.classProp : classes;
42
+ var classProp = (_props$classProp = props.classProp) != null && _props$classProp.badge ? props.classProp : classes;
43
43
  return /*#__PURE__*/_react.default.createElement(_Badge.default, {
44
44
  overlap: "circular",
45
45
  color: "primary",
@@ -186,7 +186,7 @@ var SegmentPage = function SegmentPage(_ref4) {
186
186
  modulePrependPath = _ref4.modulePrependPath,
187
187
  entityIdResolver = _ref4.entityIdResolver;
188
188
  var classes = useStyles({
189
- isComponentNull: !!!View
189
+ isComponentNull: !View
190
190
  });
191
191
  var pattern = new _urlPattern.default(path);
192
192
  var baseHref = pattern.stringify(match.params);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.resetConfig = exports.loadConfig = exports.buildUrl = void 0;
4
+ exports.resetConfig = exports.loadConfig = exports.buildUrl = exports.buildExternalAppUrl = void 0;
5
5
  (function () {
6
6
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
7
7
  enterModule && enterModule(module);
@@ -60,6 +60,17 @@ var loadConfig = exports.loadConfig = function loadConfig() {
60
60
  };
61
61
  });
62
62
  };
63
+ var buildExternalAppUrl = exports.buildExternalAppUrl = function buildExternalAppUrl(app, relativeUrl) {
64
+ var url = relativeUrl[0] === "/" ? relativeUrl.substring(1) : relativeUrl;
65
+ var lowercaseApp = app.toLowerCase();
66
+ switch (lowercaseApp) {
67
+ case "oms":
68
+ case "pim":
69
+ return "/".concat(lowercaseApp, "/app/").concat(url);
70
+ default:
71
+ throw new Error("Not implemented app '" + app + "'");
72
+ }
73
+ };
63
74
 
64
75
  /* Reset function for testing, never use this in actual code */
65
76
  var resetConfig = exports.resetConfig = function resetConfig() {
@@ -75,6 +86,7 @@ var resetConfig = exports.resetConfig = function resetConfig() {
75
86
  reactHotLoader.register(placeholder, "placeholder", "/home/vsts/work/1/s/src/utils/buildUrl.js");
76
87
  reactHotLoader.register(buildUrl, "buildUrl", "/home/vsts/work/1/s/src/utils/buildUrl.js");
77
88
  reactHotLoader.register(loadConfig, "loadConfig", "/home/vsts/work/1/s/src/utils/buildUrl.js");
89
+ reactHotLoader.register(buildExternalAppUrl, "buildExternalAppUrl", "/home/vsts/work/1/s/src/utils/buildUrl.js");
78
90
  reactHotLoader.register(resetConfig, "resetConfig", "/home/vsts/work/1/s/src/utils/buildUrl.js");
79
91
  })();
80
92
  ;
@@ -92,6 +104,7 @@ var resetConfig = exports.resetConfig = function resetConfig() {
92
104
  reactHotLoader.register(placeholder, "placeholder", "/home/vsts/work/1/s/src/utils/buildUrl.js");
93
105
  reactHotLoader.register(buildUrl, "buildUrl", "/home/vsts/work/1/s/src/utils/buildUrl.js");
94
106
  reactHotLoader.register(loadConfig, "loadConfig", "/home/vsts/work/1/s/src/utils/buildUrl.js");
107
+ reactHotLoader.register(buildExternalAppUrl, "buildExternalAppUrl", "/home/vsts/work/1/s/src/utils/buildUrl.js");
95
108
  reactHotLoader.register(resetConfig, "resetConfig", "/home/vsts/work/1/s/src/utils/buildUrl.js");
96
109
  })();
97
110
  ;
@@ -22,7 +22,10 @@ if ("".normalize) {
22
22
  normalizeForSearch = function normalizeForSearch(str) {
23
23
  return str.toLowerCase()
24
24
  // Strip accents by normalizing to letters + combining chars, then strip all combining chars.
25
- .normalize("NFKD").replace(/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/g, "");
25
+ .normalize("NFKD")
26
+ // Note AD20240801: the new eslint config complains on the next line however I have no idea what it is supposed to do so to be safe I'll disable the warning
27
+ // eslint-disable-next-line no-misleading-character-class
28
+ .replace(/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/g, "");
26
29
  };
27
30
  } else {
28
31
  // IE11 does not support string#normalize(). V. sad for IE users.
@@ -127,7 +127,7 @@ var getPropertyBagFormattedPrimitiveValue = exports.getPropertyBagFormattedPrimi
127
127
  return null;
128
128
  }
129
129
  if (dataTypesChecker.isBoolean(propertyBagValue[_constants.serializationTypeKey])) {
130
- return Boolean(propertyBagValue.value) ? formatMessage(_sharedMessages.default.valueTypeWrapperTrue) : formatMessage(_sharedMessages.default.valueTypeWrapperFalse);
130
+ return propertyBagValue.value ? formatMessage(_sharedMessages.default.valueTypeWrapperTrue) : formatMessage(_sharedMessages.default.valueTypeWrapperFalse);
131
131
  }
132
132
  if (dataTypesChecker.isInteger(propertyBagValue[_constants.serializationTypeKey])) {
133
133
  return formatNumber(propertyBagValue.value, 0);
@@ -153,7 +153,7 @@ var formatNumber = exports.formatNumber = function formatNumber(value, precision
153
153
  };
154
154
  var fixPropertyBagModifiedModel = exports.fixPropertyBagModifiedModel = function fixPropertyBagModifiedModel(model) {
155
155
  var fixProfileOperations = function fixProfileOperations(model) {
156
- if (model.hasOwnProperty("profileOperations")) {
156
+ if (Object.prototype.hasOwnProperty.call(model, "profileOperations")) {
157
157
  var _model$profileOperati = model.profileOperations,
158
158
  profilesToAdd = _model$profileOperati.profilesToAdd,
159
159
  profilesToUpdate = _model$profileOperati.profilesToUpdate;
@@ -198,7 +198,7 @@ var fixPropertyBagEmptyValues = exports.fixPropertyBagEmptyValues = function fix
198
198
  var modifiedFields = Object.keys(propertyBag);
199
199
  modifiedFields.forEach(function (propertyName) {
200
200
  var property = propertyBag[propertyName];
201
- var propertyValue = property && (0, _propertyValidator.isObject)(property) && property.hasOwnProperty("value") ? property.value : property;
201
+ var propertyValue = property && (0, _propertyValidator.isObject)(property) && Object.prototype.hasOwnProperty.call(property, "value") ? property.value : property;
202
202
  if (propertyValue === "") {
203
203
  propertyBag[propertyName] = null;
204
204
  }
@@ -48,11 +48,11 @@ function getPropertyOrDefault(obj, property, defaultValue, ignoreCase, startWith
48
48
  return getPropertyOrDefaultFromMap(obj, property, defaultValue, ignoreCase, startWith);
49
49
  }
50
50
  if (ignoreCase === false && startWith === false) {
51
- return obj.hasOwnProperty(property) ? obj[property] : defaultValue;
51
+ return Object.prototype.hasOwnProperty.call(obj, property) ? obj[property] : defaultValue;
52
52
  }
53
53
  var compareFunction = startWith ? caseInsensitiveStartWithCompare : caseInsensitiveCompare;
54
54
  for (var prop in obj) {
55
- if (obj.hasOwnProperty(prop) && compareFunction(prop, property)) {
55
+ if (Object.prototype.hasOwnProperty.call(obj, prop) && compareFunction(prop, property)) {
56
56
  return obj[prop];
57
57
  }
58
58
  }
@@ -60,11 +60,11 @@ function getPropertyOrDefault(obj, property, defaultValue, ignoreCase, startWith
60
60
  }
61
61
  var isObjectContainsPropertyWithValue = exports.isObjectContainsPropertyWithValue = function isObjectContainsPropertyWithValue(obj, propertyName, value) {
62
62
  if (obj === null || obj === undefined) return false;
63
- if (obj.hasOwnProperty(propertyName) && obj[propertyName] === value) {
63
+ if (Object.prototype.hasOwnProperty.call(obj, propertyName) && obj[propertyName] === value) {
64
64
  return true;
65
65
  }
66
66
  for (var prop in obj) {
67
- if (obj.hasOwnProperty(prop) && typeof obj[prop] === "object") {
67
+ if (Object.prototype.hasOwnProperty.call(obj, prop) && typeof obj[prop] === "object") {
68
68
  if (isObjectContainsPropertyWithValue(obj[prop], propertyName, value)) return true;
69
69
  }
70
70
  }
@@ -72,11 +72,11 @@ var isObjectContainsPropertyWithValue = exports.isObjectContainsPropertyWithValu
72
72
  };
73
73
  var isObjectContainsPropertyWithAnyValue = exports.isObjectContainsPropertyWithAnyValue = function isObjectContainsPropertyWithAnyValue(obj, propertyName) {
74
74
  if (!obj) return false;
75
- if (obj.hasOwnProperty(propertyName) && obj[propertyName]) {
75
+ if (Object.prototype.hasOwnProperty.call(obj, propertyName) && obj[propertyName]) {
76
76
  return true;
77
77
  }
78
78
  for (var prop in obj) {
79
- if (obj.hasOwnProperty(prop) && typeof obj[prop] === "object") {
79
+ if (Object.prototype.hasOwnProperty.call(obj, prop) && typeof obj[prop] === "object") {
80
80
  if (isObjectContainsPropertyWithAnyValue(obj[prop], propertyName)) return true;
81
81
  }
82
82
  }
@@ -43,6 +43,7 @@ var spyOnConsole = exports.spyOnConsole = function spyOnConsole(spyNames) {
43
43
  spyNames = ["log", "warn", "error"];
44
44
  }
45
45
  var spiedFuncs;
46
+ // eslint-disable-next-line no-undef
46
47
  beforeEach(function () {
47
48
  spiedFuncs = spyNames.map(function (funcName) {
48
49
  var func = sinon.spy().named("console." + funcName);
@@ -51,6 +52,7 @@ var spyOnConsole = exports.spyOnConsole = function spyOnConsole(spyNames) {
51
52
  return oldFunc;
52
53
  });
53
54
  });
55
+ // eslint-disable-next-line no-undef
54
56
  afterEach(function () {
55
57
  spiedFuncs.forEach(function (func, index) {
56
58
  var name = spyNames[index];
@@ -117,6 +119,7 @@ var PropStruct = exports.PropStruct = _react.default.forwardRef(function (props,
117
119
  );
118
120
  });
119
121
  var ignoreConsoleError = exports.ignoreConsoleError = function ignoreConsoleError(func) {
122
+ // eslint-disable-next-line no-undef
120
123
  jest.spyOn(console, "error");
121
124
  console.error.mockImplementation(function () {});
122
125
  func();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orc-shared",
3
- "version": "5.8.0-dev.17",
3
+ "version": "5.8.0-dev.19",
4
4
  "description": "Shared code for Orckestra applications",
5
5
  "main": "./src/index.js",
6
6
  "exports": {
@@ -55,7 +55,7 @@
55
55
  "@testing-library/react": "^10.4.9"
56
56
  },
57
57
  "dependencies": {
58
- "orc-scripts": "^4.0.0-dev.9",
58
+ "orc-scripts": "^4.0.0-dev.10",
59
59
  "react-number-format": "^5.3.0"
60
60
  },
61
61
  "sideEffects": false,
@@ -169,7 +169,9 @@ describe("ConnectedToastList", () => {
169
169
  try {
170
170
  ReactDOM.unmountComponentAtNode(appRoot);
171
171
  ReactDOM.unmountComponentAtNode(document.getElementById("toast"));
172
- } catch (_) {}
172
+ } catch {
173
+ // don't do anything
174
+ }
173
175
  document.body.removeChild(appRoot);
174
176
  });
175
177
  });
@@ -13,7 +13,7 @@ const useStyles = makeStyles(theme => ({
13
13
 
14
14
  const Badge = ({ children, badge, ...props }) => {
15
15
  const classes = useStyles();
16
- const classProp = !!props.classProp?.badge ? props.classProp : classes;
16
+ const classProp = props.classProp?.badge ? props.classProp : classes;
17
17
 
18
18
  return (
19
19
  <BadgeMui overlap="circular" color="primary" max={999} badgeContent={badge} classes={classProp}>
@@ -22,7 +22,9 @@ describe("Modal", () => {
22
22
  afterEach(() => {
23
23
  try {
24
24
  ReactDOM.unmountComponentAtNode(appRoot);
25
- } catch (_) {}
25
+ } catch {
26
+ // don't do anything
27
+ }
26
28
  document.body.removeChild(appRoot);
27
29
  document.body.removeChild(modalRoot);
28
30
  });
@@ -35,7 +35,9 @@ describe("Wrapper", () => {
35
35
  afterEach(() => {
36
36
  try {
37
37
  ReactDOM.unmountComponentAtNode(appRoot);
38
- } catch (_) {}
38
+ } catch {
39
+ // don't do anything
40
+ }
39
41
  document.body.removeChild(appRoot);
40
42
  document.body.removeChild(modalRoot);
41
43
  });
@@ -168,7 +168,7 @@ const SegmentPage = ({
168
168
  modulePrependPath,
169
169
  entityIdResolver,
170
170
  }) => {
171
- const classes = useStyles({ isComponentNull: !!!View });
171
+ const classes = useStyles({ isComponentNull: !View });
172
172
  const pattern = new UrlPattern(path);
173
173
  const baseHref = pattern.stringify(match.params);
174
174
  const pages = [],
@@ -121,7 +121,9 @@ beforeEach(() => {
121
121
  afterEach(() => {
122
122
  try {
123
123
  ReactDOM.unmountComponentAtNode(appRoot);
124
- } catch (_) {}
124
+ } catch {
125
+ // don't do anything
126
+ }
125
127
  document.body.removeChild(appRoot);
126
128
  document.body.removeChild(modalRoot);
127
129
  });
@@ -25,7 +25,9 @@ describe("Sidepanel", () => {
25
25
  afterEach(() => {
26
26
  try {
27
27
  ReactDOM.unmountComponentAtNode(appRoot);
28
- } catch (_) {}
28
+ } catch {
29
+ // don't do anything
30
+ }
29
31
  document.body.removeChild(appRoot);
30
32
  document.body.removeChild(modalRoot);
31
33
  });
@@ -32,6 +32,19 @@ export const loadConfig = () =>
32
32
  `${host}/${pathParts.join("/")}` + (parameters ? "?" + buildParamString(parameters) : "");
33
33
  });
34
34
 
35
+ export const buildExternalAppUrl = (app, relativeUrl) => {
36
+ const url = relativeUrl[0] === "/" ? relativeUrl.substring(1) : relativeUrl;
37
+
38
+ let lowercaseApp = app.toLowerCase();
39
+ switch (lowercaseApp) {
40
+ case "oms":
41
+ case "pim":
42
+ return `/${lowercaseApp}/app/${url}`;
43
+ default:
44
+ throw new Error("Not implemented app '" + app + "'");
45
+ }
46
+ };
47
+
35
48
  /* Reset function for testing, never use this in actual code */
36
49
  export const resetConfig = () => {
37
50
  buildUrl = placeholder;
@@ -1,6 +1,6 @@
1
1
  import sinon from "sinon";
2
2
  import { spyOnConsole } from "./testUtils";
3
- import { loadConfig, resetConfig, buildUrl } from "./buildUrl";
3
+ import { loadConfig, resetConfig, buildUrl, buildExternalAppUrl } from "./buildUrl";
4
4
 
5
5
  describe("loadConfig", () => {
6
6
  spyOnConsole();
@@ -72,4 +72,30 @@ describe("loadConfig", () => {
72
72
  ));
73
73
  });
74
74
  });
75
+
76
+ describe("buildExternalAppUrl", () => {
77
+ it("throws an error if called with an unknown app", () => {
78
+ expect(
79
+ () => expect(buildExternalAppUrl, "when called with", ["unknown", "fakeurl"]),
80
+ "to throw",
81
+ "Not implemented app 'unknown'",
82
+ );
83
+ });
84
+
85
+ it("should build an valid relative url with oms", () => {
86
+ expect(buildExternalAppUrl, "called with", ["oms", "fakeurl"], "to equal", "/oms/app/fakeurl");
87
+ });
88
+
89
+ it("should build an valid relative url with pim", () => {
90
+ expect(buildExternalAppUrl, "called with", ["pim", "fakeurl"], "to equal", "/pim/app/fakeurl");
91
+ });
92
+
93
+ it("should not be case sensitive about the app name", () => {
94
+ expect(buildExternalAppUrl, "called with", ["PIM", "fakeurl"], "to equal", "/pim/app/fakeurl");
95
+ });
96
+
97
+ it("should handle delimiter", () => {
98
+ expect(buildExternalAppUrl, "called with", ["pim", "/fakeurl"], "to equal", "/pim/app/fakeurl");
99
+ });
100
+ });
75
101
  });
@@ -6,6 +6,8 @@ if ("".normalize) {
6
6
  .toLowerCase()
7
7
  // Strip accents by normalizing to letters + combining chars, then strip all combining chars.
8
8
  .normalize("NFKD")
9
+ // Note AD20240801: the new eslint config complains on the next line however I have no idea what it is supposed to do so to be safe I'll disable the warning
10
+ // eslint-disable-next-line no-misleading-character-class
9
11
  .replace(/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/g, "");
10
12
  } else {
11
13
  // IE11 does not support string#normalize(). V. sad for IE users.
@@ -149,7 +149,7 @@ export const getPropertyBagFormattedPrimitiveValue = (propertyBagValue, formatMe
149
149
  }
150
150
 
151
151
  if (dataTypesChecker.isBoolean(propertyBagValue[serializationTypeKey])) {
152
- return Boolean(propertyBagValue.value)
152
+ return propertyBagValue.value
153
153
  ? formatMessage(sharedMessages.valueTypeWrapperTrue)
154
154
  : formatMessage(sharedMessages.valueTypeWrapperFalse);
155
155
  }
@@ -182,7 +182,7 @@ export const formatNumber = (value, precision) => Number(value).toFixed(precisio
182
182
 
183
183
  export const fixPropertyBagModifiedModel = (model, ...fields) => {
184
184
  const fixProfileOperations = model => {
185
- if (model.hasOwnProperty("profileOperations")) {
185
+ if (Object.prototype.hasOwnProperty.call(model, "profileOperations")) {
186
186
  let { profilesToAdd, profilesToUpdate } = model.profileOperations;
187
187
  if (profilesToAdd) {
188
188
  const items = Array.isArray(profilesToAdd) ? profilesToAdd : Object.values(profilesToAdd);
@@ -224,7 +224,10 @@ export const fixPropertyBagEmptyValues = propertyBag => {
224
224
  const modifiedFields = Object.keys(propertyBag);
225
225
  modifiedFields.forEach(propertyName => {
226
226
  let property = propertyBag[propertyName];
227
- let propertyValue = property && isObject(property) && property.hasOwnProperty("value") ? property.value : property;
227
+ let propertyValue =
228
+ property && isObject(property) && Object.prototype.hasOwnProperty.call(property, "value")
229
+ ? property.value
230
+ : property;
228
231
  if (propertyValue === "") {
229
232
  propertyBag[propertyName] = null;
230
233
  }
@@ -22,13 +22,13 @@ export function getPropertyOrDefault(obj, property, defaultValue, ignoreCase = f
22
22
  }
23
23
 
24
24
  if (ignoreCase === false && startWith === false) {
25
- return obj.hasOwnProperty(property) ? obj[property] : defaultValue;
25
+ return Object.prototype.hasOwnProperty.call(obj, property) ? obj[property] : defaultValue;
26
26
  }
27
27
 
28
28
  const compareFunction = startWith ? caseInsensitiveStartWithCompare : caseInsensitiveCompare;
29
29
 
30
30
  for (let prop in obj) {
31
- if (obj.hasOwnProperty(prop) && compareFunction(prop, property)) {
31
+ if (Object.prototype.hasOwnProperty.call(obj, prop) && compareFunction(prop, property)) {
32
32
  return obj[prop];
33
33
  }
34
34
  }
@@ -39,12 +39,12 @@ export function getPropertyOrDefault(obj, property, defaultValue, ignoreCase = f
39
39
  export const isObjectContainsPropertyWithValue = (obj, propertyName, value) => {
40
40
  if (obj === null || obj === undefined) return false;
41
41
 
42
- if (obj.hasOwnProperty(propertyName) && obj[propertyName] === value) {
42
+ if (Object.prototype.hasOwnProperty.call(obj, propertyName) && obj[propertyName] === value) {
43
43
  return true;
44
44
  }
45
45
 
46
46
  for (let prop in obj) {
47
- if (obj.hasOwnProperty(prop) && typeof obj[prop] === "object") {
47
+ if (Object.prototype.hasOwnProperty.call(obj, prop) && typeof obj[prop] === "object") {
48
48
  if (isObjectContainsPropertyWithValue(obj[prop], propertyName, value)) return true;
49
49
  }
50
50
  }
@@ -55,12 +55,12 @@ export const isObjectContainsPropertyWithValue = (obj, propertyName, value) => {
55
55
  export const isObjectContainsPropertyWithAnyValue = (obj, propertyName) => {
56
56
  if (!obj) return false;
57
57
 
58
- if (obj.hasOwnProperty(propertyName) && obj[propertyName]) {
58
+ if (Object.prototype.hasOwnProperty.call(obj, propertyName) && obj[propertyName]) {
59
59
  return true;
60
60
  }
61
61
 
62
62
  for (let prop in obj) {
63
- if (obj.hasOwnProperty(prop) && typeof obj[prop] === "object") {
63
+ if (Object.prototype.hasOwnProperty.call(obj, prop) && typeof obj[prop] === "object") {
64
64
  if (isObjectContainsPropertyWithAnyValue(obj[prop], propertyName)) return true;
65
65
  }
66
66
  }
@@ -15,6 +15,7 @@ const sinon = require("sinon");
15
15
  /* istanbul ignore next */
16
16
  export const spyOnConsole = (spyNames = ["log", "warn", "error"]) => {
17
17
  let spiedFuncs;
18
+ // eslint-disable-next-line no-undef
18
19
  beforeEach(() => {
19
20
  spiedFuncs = spyNames.map(funcName => {
20
21
  const func = sinon.spy().named("console." + funcName);
@@ -23,6 +24,7 @@ export const spyOnConsole = (spyNames = ["log", "warn", "error"]) => {
23
24
  return oldFunc;
24
25
  });
25
26
  });
27
+ // eslint-disable-next-line no-undef
26
28
  afterEach(() => {
27
29
  spiedFuncs.forEach((func, index) => {
28
30
  const name = spyNames[index];
@@ -74,34 +76,35 @@ export const PropStruct = React.forwardRef((props, ref) => (
74
76
  value === undefined || value === null
75
77
  ? null
76
78
  : value === "__ignore"
77
- ? [<Ignore key={"dt-" + key} />, <Ignore key={"dd-" + key} />]
78
- : [
79
- <dt key={"dt-" + key}>{`${key}:`}</dt>,
80
- <dd key={"dd-" + key}>
81
- {key === "children" ? (
82
- value
83
- ) : typeof value === "object" ? (
84
- value["$$typeof"] && value["$$typeof"] === Symbol.for("react.element") ? (
85
- "React <" + (value.type.name || value.type) + ">"
79
+ ? [<Ignore key={"dt-" + key} />, <Ignore key={"dd-" + key} />]
80
+ : [
81
+ <dt key={"dt-" + key}>{`${key}:`}</dt>,
82
+ <dd key={"dd-" + key}>
83
+ {key === "children" ? (
84
+ value
85
+ ) : typeof value === "object" ? (
86
+ value["$$typeof"] && value["$$typeof"] === Symbol.for("react.element") ? (
87
+ "React <" + (value.type.name || value.type) + ">"
88
+ ) : (
89
+ <PropStruct {...value} />
90
+ )
91
+ ) : typeof value === "function" ? (
92
+ "Function"
93
+ ) : typeof value === "string" ? (
94
+ `string "${value}"`
95
+ ) : typeof value === "symbol" ? (
96
+ `symbol ${value.toString()}`
86
97
  ) : (
87
- <PropStruct {...value} />
88
- )
89
- ) : typeof value === "function" ? (
90
- "Function"
91
- ) : typeof value === "string" ? (
92
- `string "${value}"`
93
- ) : typeof value === "symbol" ? (
94
- `symbol ${value.toString()}`
95
- ) : (
96
- typeof value + " " + value
97
- )}
98
- </dd>,
99
- ],
98
+ typeof value + " " + value
99
+ )}
100
+ </dd>,
101
+ ],
100
102
  )}
101
103
  </dl>
102
104
  ));
103
105
 
104
106
  export const ignoreConsoleError = func => {
107
+ // eslint-disable-next-line no-undef
105
108
  jest.spyOn(console, "error");
106
109
  console.error.mockImplementation(() => {});
107
110