@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.cjs.js CHANGED
@@ -6669,7 +6669,22 @@ var renderFormFooter = function renderFormFooter(_ref3) {
6669
6669
  };
6670
6670
 
6671
6671
  var regexValidationSchema = yup__namespace.object().shape({
6672
- condition: yup__namespace.string().required(t$1("validations.regexConditionIsRequired")).matches(/^\/.*\/[igmsyu]*$/, t$1("validations.invalidRegexPattern")),
6672
+ condition: yup__namespace.string().required(t$1("validations.regexConditionIsRequired")).matches(/^\/.*\/[igmsyu]*$/, t$1("validations.invalidRegexPattern")).test({
6673
+ name: "regex",
6674
+ message: t$1("validations.invalidRegexPattern") || "",
6675
+ test: function test(value) {
6676
+ try {
6677
+ var lastIndex = value.lastIndexOf("/");
6678
+ var condition = value.substring(1, lastIndex);
6679
+ // Evaluating the regex to check if it is valid
6680
+ new RegExp(condition);
6681
+ "".search(condition);
6682
+ return true;
6683
+ } catch (_unused) {
6684
+ return false;
6685
+ }
6686
+ }
6687
+ }),
6673
6688
  helpMessage: yup__namespace.string().required(t$1("validations.regexHelpMessageIsRequired"))
6674
6689
  });
6675
6690
  var dropDownOptionsValidationSchema = yup__namespace.array().of(yup__namespace.object().shape({