@sap-ux/preview-middleware 0.17.17 → 0.17.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.
Files changed (72) hide show
  1. package/dist/client/adp/api-handler.js +153 -153
  2. package/dist/client/adp/command-executor.js +75 -75
  3. package/dist/client/adp/control-utils.js +44 -44
  4. package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
  5. package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
  6. package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
  7. package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
  8. package/dist/client/adp/dialog-factory.js +122 -122
  9. package/dist/client/adp/init-dialogs.js +100 -100
  10. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -55
  11. package/dist/client/adp/quick-actions/common/create-page-action.js +50 -50
  12. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -36
  13. package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -48
  14. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  15. package/dist/client/adp/quick-actions/control-types.js +21 -21
  16. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  17. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  18. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  19. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +70 -70
  20. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -96
  21. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
  22. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  23. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
  24. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +58 -58
  25. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  26. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +81 -81
  27. package/dist/client/adp/quick-actions/fe-v2/registry.js +75 -75
  28. package/dist/client/adp/quick-actions/fe-v2/utils.js +95 -95
  29. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +73 -73
  30. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +49 -49
  31. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -46
  32. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
  33. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
  34. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  35. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
  36. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  37. package/dist/client/adp/quick-actions/fe-v4/registry.js +58 -58
  38. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  39. package/dist/client/adp/quick-actions/load.js +44 -44
  40. package/dist/client/adp/quick-actions/quick-action-base.js +53 -53
  41. package/dist/client/adp/utils.js +160 -160
  42. package/dist/client/cpe/changes/index.js +10 -10
  43. package/dist/client/cpe/changes/validator.js +39 -39
  44. package/dist/client/cpe/context-menu-service.js +56 -0
  45. package/dist/client/cpe/context-menu-service.ts +59 -0
  46. package/dist/client/cpe/documentation.js +164 -164
  47. package/dist/client/cpe/feature-service.js +36 -36
  48. package/dist/client/cpe/init.js +6 -2
  49. package/dist/client/cpe/init.ts +3 -1
  50. package/dist/client/cpe/logger.js +30 -30
  51. package/dist/client/cpe/outline/editable.js +37 -37
  52. package/dist/client/cpe/outline/nodes.js +222 -222
  53. package/dist/client/cpe/outline/nodes.ts +0 -1
  54. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  55. package/dist/client/cpe/quick-actions/registry.js +143 -143
  56. package/dist/client/cpe/quick-actions/utils.js +92 -92
  57. package/dist/client/cpe/types.js +4 -4
  58. package/dist/client/cpe/ui5-utils.js +33 -33
  59. package/dist/client/cpe/utils.js +138 -138
  60. package/dist/client/flp/WorkspaceConnector.js +86 -86
  61. package/dist/client/flp/common.js +28 -28
  62. package/dist/client/flp/enableFakeConnector.js +83 -83
  63. package/dist/client/flp/initConnectors.js +30 -30
  64. package/dist/client/flp/initRta.js +178 -178
  65. package/dist/client/i18n.js +56 -56
  66. package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +73 -1
  67. package/dist/client/utils/application.js +32 -32
  68. package/dist/client/utils/core.js +68 -68
  69. package/dist/client/utils/error.js +19 -19
  70. package/dist/client/utils/fe-v4.js +118 -118
  71. package/dist/client/utils/version.js +102 -102
  72. package/package.json +6 -6
@@ -1,58 +1,58 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/base/i18n/ResourceBundle", "sap/ui/model/resource/ResourceModel"], function (ResourceBundle, ResourceModel) {
4
- "use strict";
5
-
6
- const BUNDLE_CACHE = {};
7
- const MODEL_CACHE = {};
8
- async function getResourceBundle(key) {
9
- const cachedBundle = BUNDLE_CACHE[key];
10
- if (cachedBundle) {
11
- return cachedBundle;
12
- }
13
- const bundle = await ResourceBundle.create({
14
- bundleUrl: '/preview/client/messagebundle.properties',
15
- url: '/preview/client/messagebundle.properties',
16
- supportedLocales: [''],
17
- locale: '',
18
- async: true
19
- });
20
- BUNDLE_CACHE[key] = bundle;
21
- return bundle;
22
- }
23
- async function getResourceModel() {
24
- let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'open.ux.preview.client';
25
- const cachedModel = MODEL_CACHE[key];
26
- if (cachedModel) {
27
- return cachedModel;
28
- }
29
- const bundle = await getResourceBundle(key);
30
- const model = new ResourceModel({
31
- bundle
32
- });
33
- MODEL_CACHE[key] = model;
34
- return model;
35
- }
36
- class TextBundle {
37
- constructor(bundle) {
38
- this.bundle = bundle;
39
- }
40
- getText(key, args) {
41
- return this.bundle.getText(key, args) ?? key;
42
- }
43
- }
44
- async function getTextBundle() {
45
- let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'open.ux.preview.client';
46
- const bundle = await getResourceBundle(key);
47
- return new TextBundle(bundle);
48
- }
49
- var __exports = {
50
- __esModule: true
51
- };
52
- __exports.getResourceBundle = getResourceBundle;
53
- __exports.getResourceModel = getResourceModel;
54
- __exports.TextBundle = TextBundle;
55
- __exports.getTextBundle = getTextBundle;
56
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/base/i18n/ResourceBundle", "sap/ui/model/resource/ResourceModel"], function (ResourceBundle, ResourceModel) {
4
+ "use strict";
5
+
6
+ const BUNDLE_CACHE = {};
7
+ const MODEL_CACHE = {};
8
+ async function getResourceBundle(key) {
9
+ const cachedBundle = BUNDLE_CACHE[key];
10
+ if (cachedBundle) {
11
+ return cachedBundle;
12
+ }
13
+ const bundle = await ResourceBundle.create({
14
+ bundleUrl: '/preview/client/messagebundle.properties',
15
+ url: '/preview/client/messagebundle.properties',
16
+ supportedLocales: [''],
17
+ locale: '',
18
+ async: true
19
+ });
20
+ BUNDLE_CACHE[key] = bundle;
21
+ return bundle;
22
+ }
23
+ async function getResourceModel() {
24
+ let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'open.ux.preview.client';
25
+ const cachedModel = MODEL_CACHE[key];
26
+ if (cachedModel) {
27
+ return cachedModel;
28
+ }
29
+ const bundle = await getResourceBundle(key);
30
+ const model = new ResourceModel({
31
+ bundle
32
+ });
33
+ MODEL_CACHE[key] = model;
34
+ return model;
35
+ }
36
+ class TextBundle {
37
+ constructor(bundle) {
38
+ this.bundle = bundle;
39
+ }
40
+ getText(key, args) {
41
+ return this.bundle.getText(key, args) ?? key;
42
+ }
43
+ }
44
+ async function getTextBundle() {
45
+ let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'open.ux.preview.client';
46
+ const bundle = await getResourceBundle(key);
47
+ return new TextBundle(bundle);
48
+ }
49
+ var __exports = {
50
+ __esModule: true
51
+ };
52
+ __exports.getResourceBundle = getResourceBundle;
53
+ __exports.getResourceModel = getResourceModel;
54
+ __exports.TextBundle = TextBundle;
55
+ __exports.getTextBundle = getTextBundle;
56
+ return __exports;
57
57
  });
58
58
  //# sourceMappingURL=i18n.js.map
@@ -8,7 +8,8 @@ sap.ui.define((function () { 'use strict';
8
8
 
9
9
  (function (exports) {
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.externalFileChange = exports.setApplicationRequiresReload = exports.executeQuickAction = exports.updateQuickAction = exports.quickActionListChanged = exports.save = exports.redo = exports.undo = exports.appLoaded = exports.setSaveEnablement = exports.setUndoRedoEnablement = exports.applicationModeChanged = exports.setAppMode = exports.storageFileChanged = exports.reloadApplication = exports.showMessage = exports.changeStackModified = exports.propertyChangeFailed = exports.propertyChanged = exports.changeProperty = exports.outlineChanged = exports.deletePropertyChanges = exports.addExtensionPoint = exports.selectControl = exports.controlSelected = exports.iconsLoaded = exports.EXTERNAL_ACTION_PREFIX = exports.NESTED_QUICK_ACTION_KIND = exports.SIMPLE_QUICK_ACTION_KIND = exports.CONTROL_CHANGE_KIND = exports.UNKNOWN_CHANGE_KIND = exports.CONFIGURATION_CHANGE_KIND = exports.PROPERTY_CHANGE_KIND = exports.SAVED_CHANGE_TYPE = exports.PENDING_CHANGE_TYPE = exports.PropertyType = exports.SCENARIO = exports.CHECKBOX_EDITOR_TYPE = exports.DROPDOWN_EDITOR_TYPE = exports.INPUT_EDITOR_TYPE = exports.STRING_VALUE_TYPE = exports.FLOAT_VALUE_TYPE = exports.INTEGER_VALUE_TYPE = exports.BOOLEAN_VALUE_TYPE = void 0;
11
+ exports.requestControlContextMenu = exports.externalFileChange = exports.setApplicationRequiresReload = exports.executeContextMenuAction = exports.executeQuickAction = exports.updateQuickAction = exports.quickActionListChanged = exports.save = exports.redo = exports.undo = exports.appLoaded = exports.setSaveEnablement = exports.setUndoRedoEnablement = exports.applicationModeChanged = exports.setAppMode = exports.storageFileChanged = exports.reloadApplication = exports.showMessage = exports.changeStackModified = exports.propertyChangeFailed = exports.propertyChanged = exports.changeProperty = exports.outlineChanged = exports.deletePropertyChanges = exports.addExtensionPoint = exports.selectControl = exports.controlSelected = exports.iconsLoaded = exports.EXTERNAL_ACTION_PREFIX = exports.REJECTED_SUFFIX = exports.FULFILLED_SUFFIX = exports.PENDING_SUFFIX = exports.NESTED_QUICK_ACTION_KIND = exports.SIMPLE_QUICK_ACTION_KIND = exports.CONTROL_CHANGE_KIND = exports.UNKNOWN_CHANGE_KIND = exports.CONFIGURATION_CHANGE_KIND = exports.PROPERTY_CHANGE_KIND = exports.SAVED_CHANGE_TYPE = exports.PENDING_CHANGE_TYPE = exports.PropertyType = exports.SCENARIO = exports.CHECKBOX_EDITOR_TYPE = exports.DROPDOWN_EDITOR_TYPE = exports.INPUT_EDITOR_TYPE = exports.STRING_VALUE_TYPE = exports.FLOAT_VALUE_TYPE = exports.INTEGER_VALUE_TYPE = exports.BOOLEAN_VALUE_TYPE = void 0;
12
+ exports.createAsyncActionFactory = createAsyncActionFactory;
12
13
  exports.BOOLEAN_VALUE_TYPE = 'boolean';
13
14
  exports.INTEGER_VALUE_TYPE = 'integer';
14
15
  exports.FLOAT_VALUE_TYPE = 'float';
@@ -72,6 +73,74 @@ sap.ui.define((function () { 'use strict';
72
73
  return action;
73
74
  };
74
75
  }
76
+ exports.PENDING_SUFFIX = '<pending>';
77
+ exports.FULFILLED_SUFFIX = '<fulfilled>';
78
+ exports.REJECTED_SUFFIX = '<rejected>';
79
+ /**
80
+ * Factory for creating request response actions.
81
+ *
82
+ * @param prefix action prefix
83
+ * @returns Function
84
+ */
85
+ function createAsyncActionFactory(prefix) {
86
+ return function createAction(name) {
87
+ const pendingType = [prefix, name, exports.PENDING_SUFFIX].join(' ');
88
+ /**
89
+ * Pending action.
90
+ *
91
+ * @param payload action payload
92
+ * @returns PayloadAction<typeof pendingType, T>
93
+ */
94
+ function pending(payload) {
95
+ return {
96
+ type: pendingType,
97
+ payload
98
+ };
99
+ }
100
+ pending.type = pendingType;
101
+ pending.match = createMatcher(pendingType);
102
+ const fulfilledType = [prefix, name, exports.FULFILLED_SUFFIX].join(' ');
103
+ /**
104
+ * Fulfill action.
105
+ *
106
+ * @param payload action payload
107
+ * @returns PayloadAction<typeof fulfilledType, F>
108
+ */
109
+ function fulfilled(payload) {
110
+ return {
111
+ type: fulfilledType,
112
+ payload
113
+ };
114
+ }
115
+ fulfilled.type = fulfilledType;
116
+ fulfilled.match = createMatcher(fulfilledType);
117
+ const rejectedType = [prefix, name, exports.REJECTED_SUFFIX].join(' ');
118
+ /**
119
+ * Reject action.
120
+ *
121
+ * @param message error message
122
+ * @param payload R
123
+ * @returns ErrorAction<typeof rejectedType, F>
124
+ */
125
+ function rejected(message, payload) {
126
+ return {
127
+ type: rejectedType,
128
+ payload,
129
+ error: {
130
+ message
131
+ },
132
+ showMessage: true
133
+ };
134
+ }
135
+ rejected.type = rejectedType;
136
+ rejected.match = createMatcher(rejectedType);
137
+ return {
138
+ pending,
139
+ fulfilled,
140
+ rejected
141
+ };
142
+ };
143
+ }
75
144
  exports.EXTERNAL_ACTION_PREFIX = '[ext]';
76
145
  const createExternalAction = createActionFactory(exports.EXTERNAL_ACTION_PREFIX);
77
146
  exports.iconsLoaded = createExternalAction('icons-loaded');
@@ -98,8 +167,11 @@ sap.ui.define((function () { 'use strict';
98
167
  exports.quickActionListChanged = createExternalAction('quick-action-list-changed');
99
168
  exports.updateQuickAction = createExternalAction('update-quick-action');
100
169
  exports.executeQuickAction = createExternalAction('execute-quick-action');
170
+ exports.executeContextMenuAction = createExternalAction('execute-context-menu-action');
101
171
  exports.setApplicationRequiresReload = createExternalAction('set-application-requires-reload');
102
172
  exports.externalFileChange = createExternalAction('external-file-change');
173
+ const createAsyncExternalAction = createAsyncActionFactory(exports.EXTERNAL_ACTION_PREFIX);
174
+ exports.requestControlContextMenu = createAsyncExternalAction('request-control-context-menu');
103
175
 
104
176
  } (api));
105
177
 
@@ -1,34 +1,34 @@
1
- "use strict";
2
-
3
- sap.ui.define([], function () {
4
- "use strict";
5
-
6
- /**
7
- * Determines application type based on the manifest.json.
8
- *
9
- * @param manifest - Application Manifest.
10
- * @returns Application type.
11
- */
12
- function getApplicationType(manifest) {
13
- if (manifest['sap.ui.generic.app'] || manifest['sap.ovp']) {
14
- return 'fe-v2';
15
- } else if (manifest['sap.ui5']?.routing?.targets) {
16
- let hasV4pPages = false;
17
- Object.keys(manifest?.['sap.ui5']?.routing?.targets ?? []).forEach(target => {
18
- if (manifest?.['sap.ui5']?.routing?.targets?.[target]?.name?.startsWith('sap.fe.templates.')) {
19
- hasV4pPages = true;
20
- }
21
- });
22
- if (hasV4pPages) {
23
- return 'fe-v4';
24
- }
25
- }
26
- return 'freestyle';
27
- }
28
- var __exports = {
29
- __esModule: true
30
- };
31
- __exports.getApplicationType = getApplicationType;
32
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define([], function () {
4
+ "use strict";
5
+
6
+ /**
7
+ * Determines application type based on the manifest.json.
8
+ *
9
+ * @param manifest - Application Manifest.
10
+ * @returns Application type.
11
+ */
12
+ function getApplicationType(manifest) {
13
+ if (manifest['sap.ui.generic.app'] || manifest['sap.ovp']) {
14
+ return 'fe-v2';
15
+ } else if (manifest['sap.ui5']?.routing?.targets) {
16
+ let hasV4pPages = false;
17
+ Object.keys(manifest?.['sap.ui5']?.routing?.targets ?? []).forEach(target => {
18
+ if (manifest?.['sap.ui5']?.routing?.targets?.[target]?.name?.startsWith('sap.fe.templates.')) {
19
+ hasV4pPages = true;
20
+ }
21
+ });
22
+ if (hasV4pPages) {
23
+ return 'fe-v4';
24
+ }
25
+ }
26
+ return 'freestyle';
27
+ }
28
+ var __exports = {
29
+ __esModule: true
30
+ };
31
+ __exports.getApplicationType = getApplicationType;
32
+ return __exports;
33
33
  });
34
34
  //# sourceMappingURL=application.js.map
@@ -1,70 +1,70 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/core/Component", "sap/ui/core/Element"], function (Component, Element) {
4
- "use strict";
5
-
6
- /**
7
- * Gets Component by id.
8
- *
9
- * @param id - unique identifier for control
10
- * @returns Component | undefined
11
- */
12
- function getComponent(id) {
13
- if (Component?.getComponentById) {
14
- return Component.getComponentById(id);
15
- } else if (Component?.get) {
16
- // Older version must be still supported until maintenance period.
17
- return Component.get(id); // NOSONAR
18
- } else {
19
- // Older version must be still supported until maintenance period.
20
- return sap.ui.getCore().getComponent(id); // NOSONAR
21
- }
22
- }
23
-
24
- /**
25
- * Returns control by its global ID.
26
- *
27
- * @param id Id of the control.
28
- * @returns Control instance if it exists.
29
- */
30
- function getControlById(id) {
31
- if (typeof Element.getElementById === 'function') {
32
- return Element.getElementById(id);
33
- } else {
34
- return sap.ui.getCore().byId(id);
35
- }
36
- }
37
-
38
- /**
39
- * Checks wether this object is an instance of a ManagedObject.
40
- *
41
- * @param element An object.
42
- * @returns True if element is an instance of a ManagedObject.
43
- */
44
- function isManagedObject(element) {
45
- if (typeof element?.isA === 'function') {
46
- return element.isA('sap.ui.base.ManagedObject');
47
- }
48
- return false;
49
- }
50
-
51
- /**
52
- * Checks whether this object is an instance of the named type.
53
- *
54
- * @param type - Type to check for.
55
- * @param element - Object to check
56
- * @returns Whether this object is an instance of the given type.
57
- */
58
- function isA(type, element) {
59
- return !!element?.isA(type);
60
- }
61
- var __exports = {
62
- __esModule: true
63
- };
64
- __exports.getComponent = getComponent;
65
- __exports.getControlById = getControlById;
66
- __exports.isManagedObject = isManagedObject;
67
- __exports.isA = isA;
68
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/core/Component", "sap/ui/core/Element"], function (Component, Element) {
4
+ "use strict";
5
+
6
+ /**
7
+ * Gets Component by id.
8
+ *
9
+ * @param id - unique identifier for control
10
+ * @returns Component | undefined
11
+ */
12
+ function getComponent(id) {
13
+ if (Component?.getComponentById) {
14
+ return Component.getComponentById(id);
15
+ } else if (Component?.get) {
16
+ // Older version must be still supported until maintenance period.
17
+ return Component.get(id); // NOSONAR
18
+ } else {
19
+ // Older version must be still supported until maintenance period.
20
+ return sap.ui.getCore().getComponent(id); // NOSONAR
21
+ }
22
+ }
23
+
24
+ /**
25
+ * Returns control by its global ID.
26
+ *
27
+ * @param id Id of the control.
28
+ * @returns Control instance if it exists.
29
+ */
30
+ function getControlById(id) {
31
+ if (typeof Element.getElementById === 'function') {
32
+ return Element.getElementById(id);
33
+ } else {
34
+ return sap.ui.getCore().byId(id);
35
+ }
36
+ }
37
+
38
+ /**
39
+ * Checks wether this object is an instance of a ManagedObject.
40
+ *
41
+ * @param element An object.
42
+ * @returns True if element is an instance of a ManagedObject.
43
+ */
44
+ function isManagedObject(element) {
45
+ if (typeof element?.isA === 'function') {
46
+ return element.isA('sap.ui.base.ManagedObject');
47
+ }
48
+ return false;
49
+ }
50
+
51
+ /**
52
+ * Checks whether this object is an instance of the named type.
53
+ *
54
+ * @param type - Type to check for.
55
+ * @param element - Object to check
56
+ * @returns Whether this object is an instance of the given type.
57
+ */
58
+ function isA(type, element) {
59
+ return !!element?.isA(type);
60
+ }
61
+ var __exports = {
62
+ __esModule: true
63
+ };
64
+ __exports.getComponent = getComponent;
65
+ __exports.getControlById = getControlById;
66
+ __exports.isManagedObject = isManagedObject;
67
+ __exports.isA = isA;
68
+ return __exports;
69
69
  });
70
70
  //# sourceMappingURL=core.js.map
@@ -1,21 +1,21 @@
1
- "use strict";
2
-
3
- sap.ui.define([], function () {
4
- "use strict";
5
-
6
- /**
7
- * Returns the Error if the error is an instance of `Error` otherwise a new Error instance with string representation of the error.
8
- *
9
- * @param error {unknown} - the error instance
10
- * @returns {Error} the error
11
- */
12
- function getError(error) {
13
- return error instanceof Error ? error : new Error(JSON.stringify(error));
14
- }
15
- var __exports = {
16
- __esModule: true
17
- };
18
- __exports.getError = getError;
19
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define([], function () {
4
+ "use strict";
5
+
6
+ /**
7
+ * Returns the Error if the error is an instance of `Error` otherwise a new Error instance with string representation of the error.
8
+ *
9
+ * @param error {unknown} - the error instance
10
+ * @returns {Error} the error
11
+ */
12
+ function getError(error) {
13
+ return error instanceof Error ? error : new Error(JSON.stringify(error));
14
+ }
15
+ var __exports = {
16
+ __esModule: true
17
+ };
18
+ __exports.getError = getError;
19
+ return __exports;
20
20
  });
21
21
  //# sourceMappingURL=error.js.map