mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-11-26 15:35:52 +00:00
Apply suggestions from code review [skip ci]
Co-authored-by: Daniel Huigens <d.huigens@protonmail.com>
This commit is contained in:
parent
7d7a8dc113
commit
9729d4ff75
@ -459,8 +459,9 @@ const util = {
|
||||
|
||||
/**
|
||||
* Test email format based on W3C HTML5 specification.
|
||||
* This check is not exaustive, and includes a willful violation of RFC5322
|
||||
* (see https://html.spec.whatwg.org/multipage/input.html#email-state-(type=email))
|
||||
* This check is not exaustive, and does not match RFC 5322 exactly
|
||||
* (see https://html.spec.whatwg.org/multipage/input.html#email-state-(type=email)),
|
||||
* but is commonly used for email address validation.
|
||||
*/
|
||||
isEmailAddress: function(data) {
|
||||
if (!util.isString(data)) {
|
||||
|
||||
@ -108,7 +108,7 @@ export default () => describe('Util unit tests', function() {
|
||||
const data = 'test@example.com';
|
||||
expect(util.isEmailAddress(data)).to.be.true;
|
||||
});
|
||||
it('should return true for valid email address (-- in domain part)', function() {
|
||||
it('should return true for valid email address (internationalized domain name)', function() {
|
||||
const data = 'test@xn--wgv.xn--q9jyb4c';
|
||||
expect(util.isEmailAddress(data)).to.be.true;
|
||||
});
|
||||
@ -116,8 +116,8 @@ export default () => describe('Util unit tests', function() {
|
||||
const data = 'test1@com.com09';
|
||||
expect(util.isEmailAddress(data)).to.be.true;
|
||||
});
|
||||
it('should return false for invalid email address (no . in domain part)', function() {
|
||||
const data = 'test@examplecom';
|
||||
it('should return true for valid email address (no . in domain part)', function() {
|
||||
const data = 'test@localhost';
|
||||
expect(util.isEmailAddress(data)).to.be.true;
|
||||
});
|
||||
it('should return false for invalid email address (full userID)', function() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user