-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(isEmail) extend to enable allow_underscores in domain (#2229)
* feat(isEmail) extend isEmail validator to enable allow_underscores option, allowing successful validation of email addresses containing domains with underscores * doc(isEmail) update README to list new email option allow_underscores --------- Co-authored-by: Gus Power <[email protected]>
- Loading branch information
Showing
3 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ describe('Validators', () => { | |
'invalid.com', | ||
'@invalid.com', | ||
'[email protected].', | ||
'foo@_bar.com', | ||
'somename@gmail.com', | ||
'[email protected].', | ||
'[email protected]', | ||
|
@@ -92,6 +93,16 @@ describe('Validators', () => { | |
}); | ||
}); | ||
|
||
it('should validate email addresses with underscores in the domain', () => { | ||
test({ | ||
validator: 'isEmail', | ||
args: [{ allow_underscores: true }], | ||
valid: [ | ||
'foobar@my_sarisari_store.typepad.com', | ||
], | ||
invalid: [], | ||
}); | ||
}); | ||
|
||
it('should validate email addresses without UTF8 characters in local part', () => { | ||
test({ | ||
|