Skip to content

Commit

Permalink
fixed #13, email domain not support ~/workbench/webforms/univ character.
Browse files Browse the repository at this point in the history
  • Loading branch information
hotoo committed Feb 9, 2015
1 parent 6982b35 commit f276ea7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ function verifyIsUrl(value, validity){
}


var RE_EMAIL = /^\w+(?:[\._+\-]\w+)*@\w+(?:\.\w+)+$/;
var RE_EMAIL = /^\w+(?:[\._+\-]\w+)*@[\w_-]+(?:\.[\w_-]+)+$/;
function verifyIsEmail(value, validity){
var certified = RE_EMAIL.test(value);
validity.typeMismatch = !certified;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "univ",
"version": "0.1.6",
"version": "0.1.7",
"description": "Universal Validator.",
"keywords": ["Validator", "Form", "Forms", "WebForm", "WebForms"],
"homepage": "https://github.com/webforms/univ",
Expand Down
5 changes: 5 additions & 0 deletions tests/univ-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4237,6 +4237,11 @@ var testCases = [
"data": { a: "a@b.c" },
"test": testValid
},
{
"rule": { a: { type: "email" } },
"data": { a: "a@b-inc.c" },
"test": testValid
},
{
"rule": { a: { type: "email" } },
"data": { a: "abc@def.ghi" },
Expand Down

0 comments on commit f276ea7

Please sign in to comment.