-
-
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.
Merge pull request #832 from tux-tn/master
Add gmail validation to isEmail
- Loading branch information
Showing
5 changed files
with
78 additions
and
24 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 |
---|---|---|
|
@@ -52,8 +52,8 @@ describe('Validators', function () { | |
'hans.m端[email protected]', | ||
'hans@m端ller.com', | ||
'test|123@m端ller.com', | ||
'test[email protected]', | ||
'some.name.midd.leNa.me.[email protected]', | ||
'test123[email protected]', | ||
'[email protected]', | ||
'"foobar"@example.com', | ||
'" foo m端ller "@example.com', | ||
'"foo\\@bar"@example.com', | ||
|
@@ -73,6 +73,7 @@ describe('Validators', function () { | |
`${repeat('a', 64)}@${repeat('a', 251)}.com`, | ||
`${repeat('a', 65)}@${repeat('a', 250)}.com`, | ||
`${repeat('a', 64)}@${repeat('a', 64)}.com`, | ||
`${repeat('a', 31)}@gmail.com`, | ||
'[email protected] m', | ||
'[email protected] m', | ||
'[email protected] m', | ||
|
@@ -87,8 +88,12 @@ describe('Validators', function () { | |
'[email protected] m', | ||
'[email protected] m', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'test123+invalid! [email protected]', | ||
], | ||
}); | ||
}); | ||
|
@@ -104,8 +109,8 @@ describe('Validators', function () { | |
'[email protected]', | ||
'hans@m端ller.com', | ||
'test|123@m端ller.com', | ||
'test[email protected]', | ||
'some.name.midd.leNa.me.[email protected]', | ||
'test123[email protected]', | ||
'[email protected]', | ||
'"foobar"@example.com', | ||
'"foo\\@bar"@example.com', | ||
'" foo bar "@example.com', | ||
|
@@ -136,21 +141,21 @@ describe('Validators', function () { | |
'hans.m端[email protected]', | ||
'hans@m端ller.com', | ||
'test|123@m端ller.com', | ||
'test[email protected]', | ||
'some.name.midd.leNa.me.[email protected]', | ||
'test123[email protected]', | ||
'[email protected]', | ||
'Some Name <[email protected]>', | ||
'Some Name <[email protected]>', | ||
'Some Name <[email protected]>', | ||
'Some Name <[email protected]>', | ||
'Some Name <hans.m端[email protected]>', | ||
'Some Name <hans@m端ller.com>', | ||
'Some Name <test|123@m端ller.com>', | ||
'Some Name <test[email protected]>', | ||
'Some Name <test123[email protected]>', | ||
'\'Foo Bar, Esq\'<[email protected]>', | ||
'Some Name <some.name.midd.leNa.me.[email protected]>', | ||
'Some Middle Name <some.name.midd.leNa.me.[email protected]>', | ||
'Name <some.name.midd.leNa.me.[email protected]>', | ||
'Name<some.name.midd.leNa.me.[email protected]>', | ||
'Some Name <[email protected]>', | ||
'Some Middle Name <[email protected]>', | ||
'Name <[email protected]>', | ||
'Name<[email protected]>', | ||
], | ||
invalid: [ | ||
'invalidemail@', | ||
|
@@ -168,6 +173,7 @@ describe('Validators', function () { | |
'Some Name < [email protected] >', | ||
'Name [email protected]', | ||
'Some Name <[email protected]>', | ||
'Some Name <[email protected]>', | ||
], | ||
}); | ||
}); | ||
|
@@ -184,22 +190,22 @@ describe('Validators', function () { | |
'Some Name <hans.m端[email protected]>', | ||
'Some Name <hans@m端ller.com>', | ||
'Some Name <test|123@m端ller.com>', | ||
'Some Name <test[email protected]>', | ||
'Some Name <some.name.midd.leNa.me.[email protected]>', | ||
'Some Middle Name <some.name.midd.leNa.me.[email protected]>', | ||
'Name <some.name.midd.leNa.me.[email protected]>', | ||
'Name<some.name.midd.leNa.me.[email protected]>', | ||
'Some Name <test123[email protected]>', | ||
'Some Name <[email protected]>', | ||
'Some Middle Name <[email protected]>', | ||
'Name <[email protected]>', | ||
'Name<[email protected]>', | ||
], | ||
invalid: [ | ||
'some.name.midd.leNa.me.[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'hans.m端[email protected]', | ||
'hans@m端ller.com', | ||
'test|123@m端ller.com', | ||
'test[email protected]', | ||
'test123[email protected]', | ||
'invalidemail@', | ||
'invalid.com', | ||
'@invalid.com', | ||
|
@@ -3016,7 +3022,7 @@ describe('Validators', function () { | |
}); | ||
for (var i = 0, str = '', encoded; i < 1000; i++) { | ||
str += String.fromCharCode(Math.random() * 26 | 97); | ||
encoded = new Buffer(str).toString('base64'); | ||
encoded = Buffer.from(str).toString('base64'); | ||
if (!validator.isBase64(encoded)) { | ||
var msg = format('validator.isBase64() failed with "%s"', encoded); | ||
throw new Error(msg); | ||
|
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
Large diffs are not rendered by default.
Oops, something went wrong.