@bigbinary/neeto-fields-frontend 1.1.8 → 1.1.9

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/index.js CHANGED
@@ -6634,7 +6634,22 @@ var renderFormFooter = function renderFormFooter(_ref3) {
6634
6634
  };
6635
6635
 
6636
6636
  var regexValidationSchema = yup.object().shape({
6637
- condition: yup.string().required(t$1("validations.regexConditionIsRequired")).matches(/^\/.*\/[igmsyu]*$/, t$1("validations.invalidRegexPattern")),
6637
+ condition: yup.string().required(t$1("validations.regexConditionIsRequired")).matches(/^\/.*\/[igmsyu]*$/, t$1("validations.invalidRegexPattern")).test({
6638
+ name: "regex",
6639
+ message: t$1("validations.invalidRegexPattern") || "",
6640
+ test: function test(value) {
6641
+ try {
6642
+ var lastIndex = value.lastIndexOf("/");
6643
+ var condition = value.substring(1, lastIndex);
6644
+ // Evaluating the regex to check if it is valid
6645
+ new RegExp(condition);
6646
+ "".search(condition);
6647
+ return true;
6648
+ } catch (_unused) {
6649
+ return false;
6650
+ }
6651
+ }
6652
+ }),
6638
6653
  helpMessage: yup.string().required(t$1("validations.regexHelpMessageIsRequired"))
6639
6654
  });
6640
6655
  var dropDownOptionsValidationSchema = yup.array().of(yup.object().shape({