@punks/backend-entity-manager 0.0.410 → 0.0.412

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -40992,7 +40992,7 @@ const fieldTextValidator = (item, selector, params) => {
40992
40992
  const isMaxLengthValid = length <= (params.maxLength ?? Infinity);
40993
40993
  const isRegexValid = (typeof value === "string" && params.regex?.test(value)) ?? true;
40994
40994
  return {
40995
- isValid: isMinLengthValid && isMaxLengthValid,
40995
+ isValid: isMinLengthValid && isMaxLengthValid && isRegexValid,
40996
40996
  validationErrors: [
40997
40997
  ...(isRequiredValid ? [] : [{ errorCode: "required" }]),
40998
40998
  ...(isMinLengthValid
@@ -41011,7 +41011,9 @@ const fieldTextValidator = (item, selector, params) => {
41011
41011
  payload: { current: length, expected: params.maxLength },
41012
41012
  },
41013
41013
  ]),
41014
- ...(isRegexValid ? [] : [{ errorCode: "regex" }]),
41014
+ ...(isRegexValid
41015
+ ? []
41016
+ : [{ errorCode: params.regexErrorCode ?? "regex" }]),
41015
41017
  ],
41016
41018
  };
41017
41019
  };
@@ -41019,6 +41021,7 @@ const fieldEmailValidator = (item, selector, params) => {
41019
41021
  return fieldTextValidator(item, selector, {
41020
41022
  ...params,
41021
41023
  regex: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
41024
+ regexErrorCode: "email",
41022
41025
  });
41023
41026
  };
41024
41027
  const fieldOptionValidator = (item, selector, { availableOptions, required, }) => {