nox-validation 1.5.1 → 1.5.2
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 +5 -2
- package/package.json +1 -1
package/lib/validate.js
CHANGED
|
@@ -1144,7 +1144,10 @@ const validate = (data) => {
|
|
|
1144
1144
|
};
|
|
1145
1145
|
|
|
1146
1146
|
const addError = (fieldPath, obj, field) => {
|
|
1147
|
-
|
|
1147
|
+
const fieldKey = getLastChildKey(fieldPath);
|
|
1148
|
+
const isBypass = byPassKeys?.some((key) => key === fieldKey);
|
|
1149
|
+
|
|
1150
|
+
if (isBypass) return;
|
|
1148
1151
|
if (!result.errors[fieldPath] && !field?.meta?.hidden) {
|
|
1149
1152
|
const pathResult = extractRelationalParents(fieldPath);
|
|
1150
1153
|
if (pathResult) {
|
|
@@ -1350,7 +1353,7 @@ const validate = (data) => {
|
|
|
1350
1353
|
findDisallowedKeys(formData, fieldOptions, maxLevel).forEach((fieldPath) => {
|
|
1351
1354
|
if (abortEarly && !result.status) return result;
|
|
1352
1355
|
const fieldKey = getLastChildKey(fieldPath);
|
|
1353
|
-
const isBypass = byPassKeys?.some((key) =>
|
|
1356
|
+
const isBypass = byPassKeys?.some((key) => key === fieldKey);
|
|
1354
1357
|
if (fieldKey && !result.errors[fieldPath] && !isBypass) {
|
|
1355
1358
|
addError(fieldPath, {
|
|
1356
1359
|
label: formatLabel(fieldKey),
|