Skip to content

Commit

Permalink
fix(validation): number 0 should NOT treated as empty value
Browse files Browse the repository at this point in the history
  • Loading branch information
webzhao committed Jan 9, 2019
1 parent 2ab0136 commit 0803195
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scripts/mixins/validatable/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function isEmpty (value) {
return value.length === 0
}
if (typeof value === 'boolean') return !value
if (typeof value === 'number') return value === 0
if (typeof value === 'number') return false
if (typeof value === 'object') return Object.keys(value).length === 0
}

Expand Down

0 comments on commit 0803195

Please sign in to comment.