Skip to content
This repository has been archived by the owner on Nov 15, 2017. It is now read-only.

Commit

Permalink
Fix validation error merging
Browse files Browse the repository at this point in the history
  • Loading branch information
fastner committed May 12, 2016
1 parent ddb7ca1 commit 5af0e70
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/VuexValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,13 @@ function propertyValidator(state)

return reduce(vals.map((val) => val.validatorFunction(state)), (all, self) =>
{
if (all === true && self === true)
return true

if (all !== true && self === true)
if (!self)
return all

if (all === true && self !== true)
return self
if (all)
return all.concat(self)

return all.concat(self)
return [ self ]
})
}
}
Expand Down

0 comments on commit 5af0e70

Please sign in to comment.