|
|
|
@ -56,7 +56,7 @@ module.exports = function (alternatives) {
|
|
|
|
|
} else if (arguments.length > 1) {
|
|
|
|
|
throw new Error(`Only one argument is accepted; maybe you forgot to wrap the different alternatives into an array?`);
|
|
|
|
|
} else {
|
|
|
|
|
return combinator((value, applyValidators) => {
|
|
|
|
|
return combinator((value, applyValidators, context) => {
|
|
|
|
|
let allErrors = [];
|
|
|
|
|
|
|
|
|
|
for (let alternative of alternatives) {
|
|
|
|
@ -87,7 +87,7 @@ module.exports = function (alternatives) {
|
|
|
|
|
return hasNestedPaths(error);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (nestedErrors.length > 0) {
|
|
|
|
|
if (!context.__validatemNoHeuristics && nestedErrors.length > 0) {
|
|
|
|
|
let sameOrigin = areErrorsFromSameOrigin(nestedErrors);
|
|
|
|
|
|
|
|
|
|
if (sameOrigin || nestedErrors.length === 1) {
|
|
|
|
|