@wise/dynamic-flow-client 0.4.0 → 0.4.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.
Files changed (233) hide show
  1. package/build/common/constants/DateMode.js +2 -2
  2. package/build/common/constants/FormControlType.js +2 -2
  3. package/build/common/constants/MonthFormat.js +2 -2
  4. package/build/common/constants/SchemaType.js +2 -2
  5. package/build/common/constants/Size.js +2 -2
  6. package/build/common/constants/index.js +1 -1
  7. package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +15 -27
  8. package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +11 -9
  9. package/build/common/contexts/eventsContext/EventsContext.js +11 -28
  10. package/build/common/contexts/fetcherContexts/FetcherContexts.js +14 -27
  11. package/build/common/contexts/index.js +1 -1
  12. package/build/common/contexts/logContext/LogContext.js +12 -30
  13. package/build/common/hooks/index.js +1 -1
  14. package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js +3 -3
  15. package/build/common/hooks/useExternal/useExternal.js +8 -8
  16. package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js +20 -31
  17. package/build/common/hooks/usePersistAsync/usePersistAsync.js +60 -139
  18. package/build/common/hooks/usePolling/usePolling.js +20 -21
  19. package/build/common/hooks/usePrevious/usePrevious.js +5 -5
  20. package/build/common/hooks/useStepPolling/useStepPolling.js +15 -14
  21. package/build/common/makeFetcher/index.js +1 -1
  22. package/build/common/makeFetcher/makeFetcher.js +10 -24
  23. package/build/common/messages.js +5 -5
  24. package/build/common/utils/api-utils.js +3 -4
  25. package/build/common/utils/date-utils.js +11 -11
  26. package/build/common/utils/debounce.js +11 -15
  27. package/build/common/utils/file-utils.js +12 -25
  28. package/build/common/utils/id-utils.js +4 -5
  29. package/build/common/utils/index.js +1 -1
  30. package/build/common/utils/is-equal.js +8 -8
  31. package/build/common/utils/schema-utils.js +6 -6
  32. package/build/common/utils/step-utils.js +14 -14
  33. package/build/common/validators/index.js +7 -7
  34. package/build/common/validators/models/model-validators.js +8 -8
  35. package/build/common/validators/models/models.utils.js +29 -42
  36. package/build/common/validators/schemas/schema-validators.js +11 -13
  37. package/build/common/validators/types/type-validators.js +9 -13
  38. package/build/common/validators/validationFailures/validation-failures.js +14 -14
  39. package/build/common/validators/validationFailures/validation-failures.utils.js +5 -7
  40. package/build/common/validators/values/value-validators.js +4 -6
  41. package/build/dynamicFlow/DynamicFlow.js +185 -307
  42. package/build/dynamicFlow/DynamicFlowStep.js +12 -23
  43. package/build/dynamicFlow/DynamicFlowTypes.js +1 -1
  44. package/build/dynamicFlow/index.js +6 -14
  45. package/build/dynamicFlow/stories/DynamicFlow.story.js +20 -20
  46. package/build/dynamicFlow/stories/EditableDynamicFlow.js +20 -33
  47. package/build/dynamicFlow/stories/fixtureFetcher.js +46 -104
  48. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js +22 -40
  49. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js +6 -6
  50. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js +10 -11
  51. package/build/dynamicFlow/utils/index.js +5 -2
  52. package/build/dynamicFlow/utils/responseParsers/response-parsers.js +53 -118
  53. package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +9 -9
  54. package/build/dynamicFlow/utils/useDynamicFlowState.js +51 -74
  55. package/build/dynamicFlow/utils/useLoader.js +9 -20
  56. package/build/fixtures/components/alert.js +8 -8
  57. package/build/fixtures/components/box.js +7 -7
  58. package/build/fixtures/components/button.js +25 -36
  59. package/build/fixtures/components/columns.js +10 -10
  60. package/build/fixtures/components/copyable.js +6 -6
  61. package/build/fixtures/components/decision.js +15 -15
  62. package/build/fixtures/components/heading.js +7 -7
  63. package/build/fixtures/components/image.js +10 -10
  64. package/build/fixtures/components/index.js +17 -25
  65. package/build/fixtures/components/info.js +22 -6
  66. package/build/fixtures/components/list.js +8 -8
  67. package/build/fixtures/components/loading-indicator.js +5 -5
  68. package/build/fixtures/components/paragraph.js +9 -9
  69. package/build/fixtures/components/review.js +11 -11
  70. package/build/fixtures/examples/camera-capture.js +29 -29
  71. package/build/fixtures/examples/index.js +9 -17
  72. package/build/fixtures/examples/recipient-update.js +69 -69
  73. package/build/fixtures/examples/recipient.js +63 -63
  74. package/build/fixtures/examples/single-file-upload.js +21 -21
  75. package/build/fixtures/examples/step-validation-errors.js +21 -21
  76. package/build/fixtures/features/action-response.js +8 -8
  77. package/build/fixtures/features/external.js +8 -8
  78. package/build/fixtures/features/index.js +9 -17
  79. package/build/fixtures/features/persist-async.js +11 -11
  80. package/build/fixtures/features/polling.js +9 -9
  81. package/build/fixtures/features/validation-async.js +10 -10
  82. package/build/fixtures/index.js +11 -22
  83. package/build/fixtures/jsonSchemaForm/allOf.js +30 -30
  84. package/build/fixtures/jsonSchemaForm/audRecipient.js +271 -271
  85. package/build/fixtures/jsonSchemaForm/currency.js +12 -12
  86. package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js +11 -11
  87. package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js +11 -11
  88. package/build/fixtures/jsonSchemaForm/oneOf.js +27 -27
  89. package/build/fixtures/jsonSchemaForm/oneOfTabs.js +16 -16
  90. package/build/fixtures/jsonSchemaForm/promotedOneOf.js +17 -17
  91. package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js +30 -30
  92. package/build/fixtures/jsonSchemaForm/simple.js +16 -16
  93. package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js +19 -19
  94. package/build/fixtures/jsonSchemaForm/validationAsync.js +8 -8
  95. package/build/fixtures/layouts/all.js +37 -37
  96. package/build/fixtures/layouts/final-step-layout.js +9 -9
  97. package/build/fixtures/layouts/index.js +10 -18
  98. package/build/fixtures/layouts/list.js +10 -10
  99. package/build/fixtures/layouts/pay-in.js +23 -23
  100. package/build/fixtures/layouts/review.js +38 -38
  101. package/build/fixtures/layouts/success.js +15 -15
  102. package/build/fixtures/responses/action-response-final.js +8 -8
  103. package/build/fixtures/responses/action.js +3 -3
  104. package/build/fixtures/responses/exit.js +3 -3
  105. package/build/fixtures/responses/index.js +8 -16
  106. package/build/fixtures/responses/recipient-update-final.js +8 -8
  107. package/build/fixtures/schemas/basic-form.js +11 -11
  108. package/build/fixtures/schemas/index.js +8 -16
  109. package/build/fixtures/schemas/number-and-integer.js +11 -11
  110. package/build/fixtures/schemas/one-of.js +43 -46
  111. package/build/fixtures/schemas/string-formats.js +15 -15
  112. package/build/fixtures/utils/image-util.js +8 -8
  113. package/build/formControl/FormControl.js +118 -148
  114. package/build/formControl/index.js +6 -14
  115. package/build/formControl/utils/index.js +1 -1
  116. package/build/formControl/utils/value-utils.js +18 -23
  117. package/build/i18n/index.js +31 -31
  118. package/build/index.js +13 -10
  119. package/build/jsonSchemaForm/JsonSchemaForm.js +12 -24
  120. package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +24 -37
  121. package/build/jsonSchemaForm/allOfSchema/index.js +6 -14
  122. package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +9 -20
  123. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +9 -20
  124. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +6 -14
  125. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +56 -115
  126. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +7 -7
  127. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +6 -14
  128. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +1 -1
  129. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +19 -71
  130. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +10 -11
  131. package/build/jsonSchemaForm/arrayTypeSchema/index.js +6 -14
  132. package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +45 -62
  133. package/build/jsonSchemaForm/basicTypeSchema/index.js +6 -14
  134. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +39 -50
  135. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +18 -18
  136. package/build/jsonSchemaForm/controlFeedback/index.js +6 -14
  137. package/build/jsonSchemaForm/genericSchema/GenericSchema.js +52 -61
  138. package/build/jsonSchemaForm/genericSchema/index.js +6 -14
  139. package/build/jsonSchemaForm/help/Help.js +9 -9
  140. package/build/jsonSchemaForm/help/Help.messages.js +5 -5
  141. package/build/jsonSchemaForm/help/index.js +6 -14
  142. package/build/jsonSchemaForm/index.js +6 -14
  143. package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +28 -49
  144. package/build/jsonSchemaForm/objectSchema/index.js +6 -14
  145. package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +54 -74
  146. package/build/jsonSchemaForm/oneOfSchema/index.js +6 -14
  147. package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js +3 -3
  148. package/build/jsonSchemaForm/oneOfSchema/utils/index.js +1 -1
  149. package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js +19 -20
  150. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +11 -22
  151. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +5 -5
  152. package/build/jsonSchemaForm/persistAsyncSchema/index.js +6 -14
  153. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +73 -127
  154. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +6 -14
  155. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +45 -110
  156. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +17 -17
  157. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +6 -14
  158. package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +28 -47
  159. package/build/jsonSchemaForm/promotedOneOfSchema/index.js +6 -14
  160. package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +4 -4
  161. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +13 -24
  162. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +11 -22
  163. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +12 -23
  164. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +24 -26
  165. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +6 -6
  166. package/build/jsonSchemaForm/readOnlySchema/index.js +6 -14
  167. package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +26 -39
  168. package/build/jsonSchemaForm/schemaFormControl/index.js +6 -14
  169. package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js +5 -5
  170. package/build/jsonSchemaForm/schemaFormControl/utils/index.js +1 -1
  171. package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +30 -47
  172. package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +57 -119
  173. package/build/jsonSchemaForm/validationAsyncSchema/index.js +6 -14
  174. package/build/layout/DynamicLayout.js +10 -21
  175. package/build/layout/alert/DynamicAlert.js +9 -9
  176. package/build/layout/box/DynamicBox.js +12 -23
  177. package/build/layout/button/DynamicButton.js +16 -27
  178. package/build/layout/columns/DynamicColumns.js +13 -24
  179. package/build/layout/decision/DynamicDecision.js +16 -27
  180. package/build/layout/divider/DynamicDivider.js +7 -8
  181. package/build/layout/external/DynamicExternal.js +16 -28
  182. package/build/layout/external/DynamicExternal.messages.js +5 -5
  183. package/build/layout/form/DynamicForm.js +10 -21
  184. package/build/layout/heading/DynamicHeading.js +12 -23
  185. package/build/layout/icon/DynamicIcon.js +9 -10
  186. package/build/layout/image/DynamicImage.js +43 -93
  187. package/build/layout/index.js +21 -29
  188. package/build/layout/info/DynamicInfo.js +7 -19
  189. package/build/layout/list/DynamicList.js +14 -26
  190. package/build/layout/loadingIndicator/DynamicLoadingIndicator.js +8 -9
  191. package/build/layout/paragraph/DynamicParagraph.js +19 -37
  192. package/build/layout/paragraph/DynamicParagraph.messages.js +6 -6
  193. package/build/layout/paragraph/useSnackBarIfAvailable.js +4 -4
  194. package/build/layout/review/DynamicReview.js +14 -26
  195. package/build/layout/utils.js +4 -6
  196. package/build/step/cameraStep/CameraStep.js +42 -88
  197. package/build/step/cameraStep/cameraCapture/CameraCapture.js +48 -105
  198. package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +7 -7
  199. package/build/step/cameraStep/cameraCapture/components/index.js +10 -28
  200. package/build/step/cameraStep/cameraCapture/hooks/index.js +17 -72
  201. package/build/step/cameraStep/cameraCapture/index.js +6 -14
  202. package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +33 -45
  203. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +8 -19
  204. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +6 -6
  205. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +9 -21
  206. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +7 -7
  207. package/build/step/cameraStep/cameraCapture/screens/index.js +6 -14
  208. package/build/step/cameraStep/cameraCapture/tracking/index.js +17 -99
  209. package/build/step/cameraStep/cameraCapture/utils/index.js +33 -96
  210. package/build/step/cameraStep/index.js +6 -14
  211. package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +20 -21
  212. package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +8 -8
  213. package/build/step/externalConfirmationStep/index.js +6 -14
  214. package/build/step/index.js +7 -15
  215. package/build/step/layoutStep/LayoutStep.js +19 -19
  216. package/build/step/layoutStep/index.js +6 -14
  217. package/build/step/layoutStep/utils/index.js +3 -14
  218. package/build/step/layoutStep/utils/inline-reference-utils.js +29 -46
  219. package/build/step/layoutStep/utils/layout-utils.js +34 -53
  220. package/build/types/common/FormControl.js +1 -1
  221. package/build/types/index.js +13 -13
  222. package/build/types/specification/Action.js +1 -1
  223. package/build/types/specification/FileUploadSchema.js +1 -1
  224. package/build/types/specification/LayoutComponent.js +1 -1
  225. package/build/types/specification/Model.js +9 -17
  226. package/build/types/specification/PersistAsync.js +1 -1
  227. package/build/types/specification/Polling.js +1 -1
  228. package/build/types/specification/Promotion.js +1 -1
  229. package/build/types/specification/Schema.js +8 -8
  230. package/build/types/specification/Step.js +3 -5
  231. package/build/types/specification/ValidationAsync.js +1 -1
  232. package/build/types/specification/core.js +1 -1
  233. package/package.json +1 -1
@@ -13,7 +13,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
- exports.__esModule = true;
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./api-utils"), exports);
18
18
  __exportStar(require("./date-utils"), exports);
19
19
  __exportStar(require("./debounce"), exports);
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isEqual = void 0;
4
- var isEqual = function (a, b) {
4
+ const isEqual = (a, b) => {
5
5
  if (a === b) {
6
6
  return true;
7
7
  }
8
8
  if (Array.isArray(a) && Array.isArray(b)) {
9
- return a.length === b.length && a.every(function (item, index) { return (0, exports.isEqual)(item, b[index]); });
9
+ return a.length === b.length && a.every((item, index) => (0, exports.isEqual)(item, b[index]));
10
10
  }
11
11
  if (isNonNullObject(a) && isNonNullObject(b) && isObjectEquals(a, b)) {
12
12
  return true;
@@ -14,12 +14,12 @@ var isEqual = function (a, b) {
14
14
  return false;
15
15
  };
16
16
  exports.isEqual = isEqual;
17
- var isObjectEquals = function (a, b) {
18
- var keysA = Object.keys(a);
19
- var keysB = Object.keys(b);
17
+ const isObjectEquals = (a, b) => {
18
+ const keysA = Object.keys(a);
19
+ const keysB = Object.keys(b);
20
20
  return (keysA.length === keysB.length &&
21
- keysA.every(function (key) { return Object.prototype.hasOwnProperty.call(b, key) && (0, exports.isEqual)(a[key], b[key]); }));
21
+ keysA.every((key) => Object.prototype.hasOwnProperty.call(b, key) && (0, exports.isEqual)(a[key], b[key])));
22
22
  };
23
- var isNonNullObject = function (a) {
23
+ const isNonNullObject = (a) => {
24
24
  return typeof a === 'object' && a !== null;
25
25
  };
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.shouldDebounceSchema = exports.getSchemaType = exports.isAllOfSchema = exports.isOneOfSchema = exports.isPromotedOneOfSchema = exports.isReadOnlySchema = void 0;
4
- var types_1 = require("../../types");
5
- var constants_1 = require("../constants");
6
- var isReadOnlySchema = function (schema) { return !!schema.readOnly && (0, types_1.isBasicSchema)(schema); };
4
+ const types_1 = require("../../types");
5
+ const constants_1 = require("../constants");
6
+ const isReadOnlySchema = (schema) => !!schema.readOnly && (0, types_1.isBasicSchema)(schema);
7
7
  exports.isReadOnlySchema = isReadOnlySchema;
8
- var isPromotedOneOfSchema = function (schema) { return !!schema.oneOf && !!schema.promotion; };
8
+ const isPromotedOneOfSchema = (schema) => !!schema.oneOf && !!schema.promotion;
9
9
  exports.isPromotedOneOfSchema = isPromotedOneOfSchema;
10
10
  /**
11
11
  * @deprecated Please use isOneOfSchema type guard function from "dynamic-flow-types"
@@ -15,7 +15,7 @@ exports.isOneOfSchema = types_1.isOneOfSchema;
15
15
  * @deprecated Please use isAllOfSchema type guard function from "dynamic-flow-types"
16
16
  */
17
17
  exports.isAllOfSchema = types_1.isAllOfSchema;
18
- var getSchemaType = function (schema) {
18
+ const getSchemaType = (schema) => {
19
19
  // Order of application is important here
20
20
  if ((0, exports.isReadOnlySchema)(schema)) {
21
21
  return constants_1.SchemaType.READ_ONLY;
@@ -1,44 +1,44 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getStepType = exports.filterHiddenSchemas = exports.stepType = void 0;
4
- var types_1 = require("../../types");
4
+ const types_1 = require("../../types");
5
5
  exports.stepType = {
6
6
  LAYOUT: 'layout',
7
- CAMERA: 'camera'
7
+ CAMERA: 'camera',
8
8
  };
9
- var isCameraStep = function (step) {
9
+ const isCameraStep = (step) => {
10
10
  return isFormStep(step) && hasSingleAction(step) && hasSingleFileUploadSchemaWithCameraOnly(step);
11
11
  };
12
- var isFormStep = function (step) { return (step === null || step === void 0 ? void 0 : step.type) === 'form'; };
13
- var hasSingleAction = function (step) { var _a; return ((_a = step === null || step === void 0 ? void 0 : step.actions) === null || _a === void 0 ? void 0 : _a.length) === 1; };
14
- var hasSingleFileUploadSchemaWithCameraOnly = function (step) {
12
+ const isFormStep = (step) => (step === null || step === void 0 ? void 0 : step.type) === 'form';
13
+ const hasSingleAction = (step) => { var _a; return ((_a = step === null || step === void 0 ? void 0 : step.actions) === null || _a === void 0 ? void 0 : _a.length) === 1; };
14
+ const hasSingleFileUploadSchemaWithCameraOnly = (step) => {
15
15
  if (!step.schemas) {
16
16
  return false;
17
17
  }
18
- var schemas = (0, exports.filterHiddenSchemas)(step.schemas);
18
+ const schemas = (0, exports.filterHiddenSchemas)(step.schemas);
19
19
  if ((schemas === null || schemas === void 0 ? void 0 : schemas.length) !== 1) {
20
20
  return false;
21
21
  }
22
- var firstSchema = schemas[0];
22
+ const firstSchema = schemas[0];
23
23
  if (!(0, types_1.isObjectSchema)(firstSchema) || Object.values(firstSchema.properties).length !== 1) {
24
24
  return false;
25
25
  }
26
- var childSchema = Object.values(firstSchema.properties)[0];
26
+ const childSchema = Object.values(firstSchema.properties)[0];
27
27
  if (!(0, types_1.isFileUploadSchema)(childSchema)) {
28
28
  return false;
29
29
  }
30
30
  return childSchema.source === 'camera';
31
31
  };
32
- var filterHiddenSchemas = function (schemas) {
33
- return schemas.filter(function (schema) {
32
+ const filterHiddenSchemas = (schemas) => {
33
+ return schemas.filter((schema) => {
34
34
  if ((0, types_1.isObjectSchema)(schema)) {
35
- return Object.values((schema === null || schema === void 0 ? void 0 : schema.properties) || {}).find(function (schema) { return (schema === null || schema === void 0 ? void 0 : schema.hidden) !== true; });
35
+ return Object.values((schema === null || schema === void 0 ? void 0 : schema.properties) || {}).find((schema) => (schema === null || schema === void 0 ? void 0 : schema.hidden) !== true);
36
36
  }
37
37
  return (schema === null || schema === void 0 ? void 0 : schema.hidden) !== true;
38
38
  });
39
39
  };
40
40
  exports.filterHiddenSchemas = filterHiddenSchemas;
41
- var getStepType = function (step) {
41
+ const getStepType = (step) => {
42
42
  if (isCameraStep(step)) {
43
43
  return exports.stepType.CAMERA;
44
44
  }
@@ -13,16 +13,16 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
- exports.__esModule = true;
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.getArrayValidationFailures = exports.getValidationFailures = exports.isValidSchema = exports.getValidBasicModelOrNull = exports.getValidObjectModelParts = exports.getValidModelParts = void 0;
18
18
  var model_validators_1 = require("./models/model-validators");
19
- __createBinding(exports, model_validators_1, "getValidModelParts");
20
- __createBinding(exports, model_validators_1, "getValidObjectModelParts");
21
- __createBinding(exports, model_validators_1, "getValidBasicModelOrNull");
19
+ Object.defineProperty(exports, "getValidModelParts", { enumerable: true, get: function () { return model_validators_1.getValidModelParts; } });
20
+ Object.defineProperty(exports, "getValidObjectModelParts", { enumerable: true, get: function () { return model_validators_1.getValidObjectModelParts; } });
21
+ Object.defineProperty(exports, "getValidBasicModelOrNull", { enumerable: true, get: function () { return model_validators_1.getValidBasicModelOrNull; } });
22
22
  var schema_validators_1 = require("./schemas/schema-validators");
23
- __createBinding(exports, schema_validators_1, "isValidSchema");
23
+ Object.defineProperty(exports, "isValidSchema", { enumerable: true, get: function () { return schema_validators_1.isValidSchema; } });
24
24
  var validation_failures_1 = require("./validationFailures/validation-failures");
25
- __createBinding(exports, validation_failures_1, "getValidationFailures");
26
- __createBinding(exports, validation_failures_1, "getArrayValidationFailures");
25
+ Object.defineProperty(exports, "getValidationFailures", { enumerable: true, get: function () { return validation_failures_1.getValidationFailures; } });
26
+ Object.defineProperty(exports, "getArrayValidationFailures", { enumerable: true, get: function () { return validation_failures_1.getArrayValidationFailures; } });
27
27
  __exportStar(require("./types/type-validators"), exports);
28
28
  __exportStar(require("./values/value-validators"), exports);
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getValidObjectModelParts = exports.getValidBasicModelOrNull = exports.getValidModelParts = void 0;
4
- var types_1 = require("../../../types");
5
- var types_2 = require("../../../types");
6
- var validators_1 = require("../../validators");
7
- var models_utils_1 = require("./models.utils");
8
- var getValidModelParts = function (model, schema) {
4
+ const types_1 = require("../../../types");
5
+ const types_2 = require("../../../types");
6
+ const validators_1 = require("../../validators");
7
+ const models_utils_1 = require("./models.utils");
8
+ const getValidModelParts = (model, schema) => {
9
9
  if ((0, types_1.isObjectModel)(model)) {
10
10
  return getValidObjectModelParts(model, schema);
11
11
  }
@@ -22,7 +22,7 @@ function getValidBasicModelOrNull(model, schema) {
22
22
  if (schema.oneOf) {
23
23
  return (0, models_utils_1.cleanBasicModelWithOneOfSchema)(model, schema);
24
24
  }
25
- if (!(0, validators_1.isUndefined)(schema["const"]) && model === schema["const"]) {
25
+ if (!(0, validators_1.isUndefined)(schema.const) && model === schema.const) {
26
26
  return model;
27
27
  }
28
28
  if (schema.type) {
@@ -52,7 +52,7 @@ function getValidObjectModelParts(model, schema) {
52
52
  if (schema.oneOf) {
53
53
  return (0, models_utils_1.cleanObjectModelWithOneOfSchema)(model, schema);
54
54
  }
55
- if (!(0, validators_1.isUndefined)(schema["const"]) && model === schema["const"]) {
55
+ if (!(0, validators_1.isUndefined)(schema.const) && model === schema.const) {
56
56
  return model;
57
57
  }
58
58
  return (0, types_1.isObjectSchema)(schema) ? (0, models_utils_1.cleanObjectModelWithObjectSchema)(model, schema) : null;
@@ -1,36 +1,25 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.cleanObjectModelWithOneOfSchema = exports.cleanObjectModelWithAllOfSchema = exports.cleanObjectModelWithObjectSchema = exports.cleanModelWithArraySchema = exports.cleanModelWithBooleanSchema = exports.cleanModelWithNumberSchema = exports.cleanModelWithStringSchema = exports.cleanArrayModelWithOneOfSchema = exports.cleanBasicModelWithOneOfSchema = void 0;
15
- var types_1 = require("../../../types");
16
- var type_validators_1 = require("../types/type-validators");
17
- var value_validators_1 = require("../values/value-validators");
18
- var model_validators_1 = require("./model-validators");
4
+ const types_1 = require("../../../types");
5
+ const type_validators_1 = require("../types/type-validators");
6
+ const value_validators_1 = require("../values/value-validators");
7
+ const model_validators_1 = require("./model-validators");
19
8
  function cleanBasicModelWithOneOfSchema(model, schema) {
20
- return schema.oneOf.some(function (nestedSchema) { return (0, model_validators_1.getValidBasicModelOrNull)(model, nestedSchema) === model; })
9
+ return schema.oneOf.some((nestedSchema) => (0, model_validators_1.getValidBasicModelOrNull)(model, nestedSchema) === model)
21
10
  ? model
22
11
  : null;
23
12
  }
24
13
  exports.cleanBasicModelWithOneOfSchema = cleanBasicModelWithOneOfSchema;
25
14
  function cleanArrayModelWithOneOfSchema(model, schema) {
26
15
  var _a;
27
- var validModels = schema.oneOf
28
- .map(function (nestedSchema) { return getValidArrayModelOrNull(model, nestedSchema); })
29
- .filter(function (item) { return item !== null; });
16
+ const validModels = schema.oneOf
17
+ .map((nestedSchema) => getValidArrayModelOrNull(model, nestedSchema))
18
+ .filter((item) => item !== null);
30
19
  if (validModels.length === 0) {
31
20
  return null;
32
21
  }
33
- return (_a = validModels.find(function (model) { return model.some(function (item) { return item !== null; }); })) !== null && _a !== void 0 ? _a : validModels[0];
22
+ return (_a = validModels.find((model) => model.some((item) => item !== null))) !== null && _a !== void 0 ? _a : validModels[0];
34
23
  }
35
24
  exports.cleanArrayModelWithOneOfSchema = cleanArrayModelWithOneOfSchema;
36
25
  function getValidArrayModelOrNull(model, schema) {
@@ -62,24 +51,23 @@ function cleanModelWithArraySchema(model, schema) {
62
51
  return null; // we don't support tuples at the moment
63
52
  }
64
53
  if (model.length > 0) {
65
- var expectedType_1 = typeof model[0];
66
- if (!model.every(function (item) { return typeof item === expectedType_1; })) {
54
+ const expectedType = typeof model[0];
55
+ if (!model.every((item) => typeof item === expectedType)) {
67
56
  return new Array(model.length).fill(null);
68
57
  }
69
58
  }
70
- return model.map(function (childModel) { return (0, model_validators_1.getValidBasicModelOrNull)(childModel, schema.items); });
59
+ return model.map((childModel) => (0, model_validators_1.getValidBasicModelOrNull)(childModel, schema.items));
71
60
  }
72
61
  exports.cleanModelWithArraySchema = cleanModelWithArraySchema;
73
62
  function cleanObjectModelWithObjectSchema(model, schema) {
74
- return Object.keys(schema.properties).reduce(function (cleanedModel, property) {
75
- var _a;
63
+ return Object.keys(schema.properties).reduce((cleanedModel, property) => {
76
64
  // If the property exists in the model, clean it, and add it
77
65
  if (model && !(0, type_validators_1.isUndefined)(model[property])) {
78
- var subModel = model[property];
79
- var subSchema = schema.properties[property];
80
- var newValue = (0, model_validators_1.getValidModelParts)(subModel, subSchema);
66
+ const subModel = model[property];
67
+ const subSchema = schema.properties[property];
68
+ const newValue = (0, model_validators_1.getValidModelParts)(subModel, subSchema);
81
69
  if (!(0, type_validators_1.isNull)(newValue)) {
82
- return __assign(__assign({}, cleanedModel), (_a = {}, _a[property] = newValue, _a));
70
+ return Object.assign(Object.assign({}, cleanedModel), { [property]: newValue });
83
71
  }
84
72
  }
85
73
  return cleanedModel;
@@ -87,11 +75,11 @@ function cleanObjectModelWithObjectSchema(model, schema) {
87
75
  }
88
76
  exports.cleanObjectModelWithObjectSchema = cleanObjectModelWithObjectSchema;
89
77
  function cleanObjectModelWithAllOfSchema(model, schema) {
90
- return schema.allOf.reduce(function (cleanObjectModel, nestedSchema) {
91
- var validSubsetOfModel = (0, model_validators_1.getValidObjectModelParts)(model, nestedSchema);
78
+ return schema.allOf.reduce((cleanObjectModel, nestedSchema) => {
79
+ const validSubsetOfModel = (0, model_validators_1.getValidObjectModelParts)(model, nestedSchema);
92
80
  if ((0, types_1.isObjectModel)(validSubsetOfModel)) {
93
81
  // Extend model with valid subset
94
- return __assign(__assign({}, cleanObjectModel), validSubsetOfModel);
82
+ return Object.assign(Object.assign({}, cleanObjectModel), validSubsetOfModel);
95
83
  }
96
84
  return cleanObjectModel;
97
85
  }, {});
@@ -99,8 +87,8 @@ function cleanObjectModelWithAllOfSchema(model, schema) {
99
87
  exports.cleanObjectModelWithAllOfSchema = cleanObjectModelWithAllOfSchema;
100
88
  function cleanObjectModelWithOneOfSchema(model, schema) {
101
89
  return schema.oneOf
102
- .map(function (nestedSchema) { return (0, model_validators_1.getValidObjectModelParts)(model, nestedSchema); })
103
- .reduce(function (combined, current) {
90
+ .map((nestedSchema) => (0, model_validators_1.getValidObjectModelParts)(model, nestedSchema))
91
+ .reduce((combined, current) => {
104
92
  // If we didn't find anything valid yet, and current is good, return it
105
93
  if ((0, type_validators_1.isNull)(combined)) {
106
94
  return current;
@@ -118,13 +106,12 @@ function cleanObjectModelWithOneOfSchema(model, schema) {
118
106
  }
119
107
  exports.cleanObjectModelWithOneOfSchema = cleanObjectModelWithOneOfSchema;
120
108
  function deepMergeObject(object1, object2) {
121
- return Object.keys(object2).reduce(function (acc, property) {
122
- var _a, _b;
123
- var object1Property = object1[property];
124
- var object2Property = object2[property];
109
+ return Object.keys(object2).reduce((acc, property) => {
110
+ const object1Property = object1[property];
111
+ const object2Property = object2[property];
125
112
  if ((0, types_1.isObjectModel)(object1Property) && (0, types_1.isObjectModel)(object2Property)) {
126
- return __assign(__assign({}, acc), (_a = {}, _a[property] = deepMergeObject(object1Property, object2Property), _a));
113
+ return Object.assign(Object.assign({}, acc), { [property]: deepMergeObject(object1Property, object2Property) });
127
114
  }
128
- return __assign(__assign({}, acc), (_b = {}, _b[property] = object2[property], _b));
129
- }, __assign({}, object1));
115
+ return Object.assign(Object.assign({}, acc), { [property]: object2[property] });
116
+ }, Object.assign({}, object1));
130
117
  }
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isValidSchema = void 0;
4
- var types_1 = require("../../../types");
5
- var type_validators_1 = require("../types/type-validators");
6
- var validation_failures_1 = require("../validationFailures/validation-failures");
4
+ const types_1 = require("../../../types");
5
+ const type_validators_1 = require("../types/type-validators");
6
+ const validation_failures_1 = require("../validationFailures/validation-failures");
7
7
  function isValidStringSchema(value, schema) {
8
8
  return !(0, validation_failures_1.getStringValidationFailures)(value, schema).length;
9
9
  }
@@ -24,10 +24,8 @@ function isValidObjectSchema(value, schema) {
24
24
  return false;
25
25
  }
26
26
  return Object.keys(schema.properties)
27
- .map(function (propertyName) {
28
- return isObjectPropertyValid(value[propertyName], schema.properties[propertyName], schema.required && schema.required.includes(propertyName));
29
- })
30
- .every(function (property) { return property; });
27
+ .map((propertyName) => isObjectPropertyValid(value[propertyName], schema.properties[propertyName], schema.required && schema.required.includes(propertyName)))
28
+ .every((property) => property);
31
29
  }
32
30
  function isObjectPropertyValid(propertyValue, propertySchema, isRequired) {
33
31
  if (typeof propertyValue === 'undefined') {
@@ -44,21 +42,21 @@ function isValidArraySchema(value, schema) {
44
42
  }
45
43
  return (Array.isArray(value) &&
46
44
  (0, types_1.isListArraySchema)(schema) && // TupleArraySchema not yet supported
47
- value.map(function (item) { return isValidSchema(item, schema.items); }).every(function (valid) { return valid; }));
45
+ value.map((item) => isValidSchema(item, schema.items)).every((valid) => valid));
48
46
  }
49
47
  function isValidOneOfSchema(value, schema) {
50
48
  if (!(0, type_validators_1.isArray)(schema.oneOf)) {
51
49
  return false;
52
50
  }
53
- return schema.oneOf.some(function (childSchema) { return isValidSchema(value, childSchema); });
51
+ return schema.oneOf.some((childSchema) => isValidSchema(value, childSchema));
54
52
  }
55
53
  function isValidAllOfSchema(value, schema) {
56
54
  if (!(0, type_validators_1.isArray)(schema.allOf)) {
57
55
  return false;
58
56
  }
59
57
  return schema.allOf
60
- .map(function (childSchema) { return isValidSchema(value, childSchema); })
61
- .every(function (valid) { return valid; });
58
+ .map((childSchema) => isValidSchema(value, childSchema))
59
+ .every((valid) => valid);
62
60
  }
63
61
  function isValidBlobSchema(value, schema) {
64
62
  return !(0, validation_failures_1.getBlobValidationFailures)(value, schema).length;
@@ -76,7 +74,7 @@ function isValidSchema(value, schema) {
76
74
  if (schema.allOf) {
77
75
  return isValidAllOfSchema(value, schema);
78
76
  }
79
- if (schema["const"]) {
77
+ if (schema.const) {
80
78
  return isValidConstSchema(value, schema);
81
79
  }
82
80
  switch (schema.type) {
@@ -1,25 +1,21 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isUndefined = exports.isNull = exports.isArray = exports.isObject = exports.isBoolean = exports.isInteger = exports.isNumber = exports.isString = void 0;
4
- var isString = function (value) { return typeof value === 'string'; };
4
+ const isString = (value) => typeof value === 'string';
5
5
  exports.isString = isString;
6
- var isNumber = function (value) {
7
- return typeof value === 'number' && !Number.isNaN(value);
8
- };
6
+ const isNumber = (value) => typeof value === 'number' && !Number.isNaN(value);
9
7
  exports.isNumber = isNumber;
10
- var isInteger = function (value) {
8
+ const isInteger = (value) => {
11
9
  return (0, exports.isNumber)(value) && Math.floor(value) === value;
12
10
  };
13
11
  exports.isInteger = isInteger;
14
- var isBoolean = function (value) { return typeof value === 'boolean'; };
12
+ const isBoolean = (value) => typeof value === 'boolean';
15
13
  exports.isBoolean = isBoolean;
16
- var isObject = function (value) {
17
- return !(0, exports.isNull)(value) && !(0, exports.isUndefined)(value) && (value === null || value === void 0 ? void 0 : value.constructor) === Object;
18
- };
14
+ const isObject = (value) => !(0, exports.isNull)(value) && !(0, exports.isUndefined)(value) && (value === null || value === void 0 ? void 0 : value.constructor) === Object;
19
15
  exports.isObject = isObject;
20
- var isArray = function (value) { return Array.isArray(value); };
16
+ const isArray = (value) => Array.isArray(value);
21
17
  exports.isArray = isArray;
22
- var isNull = function (value) { return value === null; };
18
+ const isNull = (value) => value === null;
23
19
  exports.isNull = isNull;
24
- var isUndefined = function (value) { return typeof value === 'undefined'; };
20
+ const isUndefined = (value) => typeof value === 'undefined';
25
21
  exports.isUndefined = isUndefined;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getBlobValidationFailures = exports.getObjectValidationFailures = exports.getArrayValidationFailures = exports.getConstValidationFailures = exports.getBooleanValidationFailures = exports.getIntegerValidationFailures = exports.getNumberValidationFailures = exports.getStringValidationFailures = exports.getValidationFailures = void 0;
4
- var types_1 = require("../../../types");
5
- var Schema_1 = require("../../../types/specification/Schema");
6
- var type_validators_1 = require("../types/type-validators");
7
- var validation_failures_utils_1 = require("./validation-failures.utils");
4
+ const types_1 = require("../../../types");
5
+ const Schema_1 = require("../../../types/specification/Schema");
6
+ const type_validators_1 = require("../types/type-validators");
7
+ const validation_failures_utils_1 = require("./validation-failures.utils");
8
8
  function getValidationFailures(value, schema, isRequired) {
9
- if (schema["const"]) {
9
+ if (schema.const) {
10
10
  return getConstValidationFailures(value, schema, isRequired);
11
11
  }
12
12
  if ((0, type_validators_1.isNull)(value)) {
@@ -38,7 +38,7 @@ function getStringValidationFailures(value, schema, isRequired) {
38
38
  if (value === '' && isRequired) {
39
39
  return ['required'];
40
40
  }
41
- var failures = [];
41
+ const failures = [];
42
42
  if (!(0, validation_failures_utils_1.isValidRequired)(value, isRequired)) {
43
43
  failures.push('required');
44
44
  }
@@ -64,7 +64,7 @@ function getNumberValidationFailures(value, schema, isRequired) {
64
64
  if (!(0, type_validators_1.isNumber)(value) && !(0, type_validators_1.isNull)(value)) {
65
65
  return ['type'];
66
66
  }
67
- var failures = [];
67
+ const failures = [];
68
68
  if (!(0, validation_failures_utils_1.isValidRequired)(value, isRequired)) {
69
69
  failures.push('required');
70
70
  }
@@ -88,7 +88,7 @@ function getBooleanValidationFailures(value, _schema, isRequired) {
88
88
  if (!(0, type_validators_1.isBoolean)(value) && !(0, type_validators_1.isNull)(value)) {
89
89
  return ['type'];
90
90
  }
91
- var failures = [];
91
+ const failures = [];
92
92
  if (!(0, validation_failures_utils_1.isValidRequired)(value, isRequired)) {
93
93
  failures.push('required');
94
94
  }
@@ -99,7 +99,7 @@ function getConstValidationFailures(value, schema, isRequired) {
99
99
  if (!(0, validation_failures_utils_1.isValidRequired)(value, isRequired)) {
100
100
  return ['required'];
101
101
  }
102
- if (value !== schema["const"]) {
102
+ if (value !== schema.const) {
103
103
  return ['const'];
104
104
  }
105
105
  return [];
@@ -112,7 +112,7 @@ function getArrayValidationFailures(value, schema, isRequired) {
112
112
  if (!(0, validation_failures_utils_1.isValidRequiredArray)(value, isRequired)) {
113
113
  return ['required'];
114
114
  }
115
- var failures = [];
115
+ const failures = [];
116
116
  if (!(0, validation_failures_utils_1.isValidMinItems)(value, schema.minItems)) {
117
117
  failures.push('minItems');
118
118
  }
@@ -143,9 +143,9 @@ function getObjectValidationFailures(value, schema) {
143
143
  if (!(0, type_validators_1.isArray)(schema.required)) {
144
144
  return [];
145
145
  }
146
- var allPresent = schema.required
147
- .map(function (property) { return typeof value[property] !== 'undefined'; })
148
- .reduce(function (propertyInModel, validSoFar) { return propertyInModel && validSoFar; }, true);
146
+ const allPresent = schema.required
147
+ .map((property) => typeof value[property] !== 'undefined')
148
+ .reduce((propertyInModel, validSoFar) => propertyInModel && validSoFar, true);
149
149
  return allPresent ? [] : ['required'];
150
150
  }
151
151
  exports.getObjectValidationFailures = getObjectValidationFailures;
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isValidRequiredArray = exports.isValidMaxItems = exports.isValidMinItems = exports.isValidMinimum = exports.isValidMaximum = exports.isValidPattern = exports.isValidMaxLength = exports.isValidMinLength = exports.isValidRequired = void 0;
4
- var validators_1 = require("../../validators");
5
- function isValidRequired(value, isRequired) {
6
- if (isRequired === void 0) { isRequired = false; }
4
+ const validators_1 = require("../../validators");
5
+ function isValidRequired(value, isRequired = false) {
7
6
  return !isRequired || !(0, validators_1.isUndefined)(value);
8
7
  }
9
8
  exports.isValidRequired = isValidRequired;
10
- function isValidRequiredArray(value, isRequired) {
11
- if (isRequired === void 0) { isRequired = false; }
9
+ function isValidRequiredArray(value, isRequired = false) {
12
10
  return !isRequired || (0, validators_1.isArray)(value);
13
11
  }
14
12
  exports.isValidRequiredArray = isValidRequiredArray;
@@ -27,7 +25,7 @@ function isValidPattern(value, pattern) {
27
25
  if (value === undefined || value === null) {
28
26
  return false; // no value, but there's a pattern, therefore the value is NOT valid
29
27
  }
30
- var regex = new RegExp(pattern);
28
+ const regex = new RegExp(pattern);
31
29
  return !!regex.test(value);
32
30
  }
33
31
  exports.isValidPattern = isValidPattern;
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isEmpty = void 0;
4
- var type_validators_1 = require("../types/type-validators");
5
- var isEmpty = function (value) {
6
- return ((0, type_validators_1.isString)(value) && value.length === 0) ||
7
- (((0, type_validators_1.isObject)(value) || (0, type_validators_1.isArray)(value)) && Object.keys(value).length === 0);
8
- };
4
+ const type_validators_1 = require("../types/type-validators");
5
+ const isEmpty = (value) => ((0, type_validators_1.isString)(value) && value.length === 0) ||
6
+ (((0, type_validators_1.isObject)(value) || (0, type_validators_1.isArray)(value)) && Object.keys(value).length === 0);
9
7
  exports.isEmpty = isEmpty;