nox-validation 1.2.3 → 1.2.4

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 (2) hide show
  1. package/lib/validate.js +2 -2
  2. package/package.json +1 -1
package/lib/validate.js CHANGED
@@ -703,7 +703,7 @@ const validateField = (
703
703
  value.forEach((item, index) => {
704
704
  const itemPath = `${currentPath}[${index}]`;
705
705
 
706
- if (choices.includes(field?.meta?.interface)) {
706
+ if (choices.includes(field?.meta?.interface) && !isEmpty(item)) {
707
707
  applyValidations(field, item, addError, itemPath, formData, error_messages);
708
708
  }
709
709
 
@@ -758,7 +758,7 @@ const validateField = (
758
758
  };
759
759
 
760
760
  const applyValidations = (field, value, addError, currentPath, formData, error_messages) => {
761
- if (!field.validations || value === null || value === undefined) return true;
761
+ if (!field.validations || value === null || value === undefined || value === "") return true;
762
762
  return !field.validations.some(
763
763
  (rule) =>
764
764
  handleRule(rule, field, value, addError, currentPath, formData, error_messages) === false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nox-validation",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "validate dynamic schema",
5
5
  "main": "index.js",
6
6
  "scripts": {