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.
- package/lib/validate.js +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
|