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

Commit

Permalink
Fix result concatination of validation steps
Browse files Browse the repository at this point in the history
  • Loading branch information
fastner committed May 12, 2016
1 parent 785a8db commit 6fab3dd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/VuexValidator.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { reduce, camelCase } from "lodash"
import { reduce, camelCase, isArray } from "lodash"

const validators = []
const validatorsMap = {}
Expand Down Expand Up @@ -39,11 +39,11 @@ function computedValidation(context, id, rulesLength)
{
const curResult = context[`${id}${index}`]

if (curResult !== true)
if (allResults === true)
allResults = curResult
else
if (isArray(curResult))
if (isArray(allResults))
allResults = allResults.concat(curResult)
else
allResults = curResult
}

return allResults
Expand Down

0 comments on commit 6fab3dd

Please sign in to comment.