-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(rule): email #17
Conversation
Codecov Report
@@ Coverage Diff @@
## devel #17 +/- ##
==========================================
+ Coverage 94.23% 94.48% +0.24%
==========================================
Files 5 5
Lines 538 562 +24
==========================================
+ Hits 507 531 +24
Misses 31 31 |
1 similar comment
Codecov Report
@@ Coverage Diff @@
## devel #17 +/- ##
==========================================
+ Coverage 94.23% 94.48% +0.24%
==========================================
Files 5 5
Lines 538 562 +24
==========================================
+ Hits 507 531 +24
Misses 31 31 |
src/validators.js
Outdated
@@ -106,3 +106,11 @@ export function validateRegex(attribute, value, parameters) { | |||
|
|||
return regex ? regex.test(value) : true | |||
} | |||
|
|||
export function validateEmail(attribute, value) { | |||
if (is.not.string(value) && is.not.number(value)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return is.email(value)
should be enough, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, for example ['daniel@ss.com']
passes even if array is not a valid email
…into validator#Email # Conflicts: # src/messages.js # src/validators.js
Codecov Report
@@ Coverage Diff @@
## devel #17 +/- ##
==========================================
- Coverage 94.56% 94.48% -0.08%
==========================================
Files 5 5
Lines 570 562 -8
==========================================
- Hits 539 531 -8
Misses 31 31 |
Codecov Report
@@ Coverage Diff @@
## devel #17 +/- ##
==========================================
+ Coverage 94.56% 94.78% +0.21%
==========================================
Files 5 5
Lines 570 594 +24
==========================================
+ Hits 539 563 +24
Misses 31 31 |
Codecov Report
@@ Coverage Diff @@
## devel #17 +/- ##
==========================================
+ Coverage 94.56% 94.78% +0.21%
==========================================
Files 5 5
Lines 570 594 +24
==========================================
+ Hits 539 563 +24
Misses 31 31 |
No description provided.