@moreapp/common-nodejs 0.7.6 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils.js +1 -1
- package/dist/utils.test.js +1 -1
- package/package.json +1 -1
package/dist/utils.js
CHANGED
|
@@ -34,7 +34,7 @@ function currentTraceId() {
|
|
|
34
34
|
exports.currentTraceId = currentTraceId;
|
|
35
35
|
const emailAddressMaxLength = 254; // https://stackoverflow.com/a/574698
|
|
36
36
|
const emailAddressLocalPattern = /^.+$/;
|
|
37
|
-
const emailAddressDomainPattern = /^(?:[a-z0-9](?:[a-z0-9
|
|
37
|
+
const emailAddressDomainPattern = /^(?:[a-z0-9À-ž](?:[a-z0-9À-ž-]{0,61}[a-z0-9À-ž])?\.)+[a-z0-9À-ž][a-z0-9À-ž-]{0,61}[a-z0-9]$/;
|
|
38
38
|
// There are many regex patterns to validate email addresses, but they all have flaws and cannot 100% correctly verify
|
|
39
39
|
// every possible email address. For us, it's more important to avoid the majority of typo's instead of catching every
|
|
40
40
|
// invalid email address. We let our email provider handle and false positives (either by their validation or the fact
|
package/dist/utils.test.js
CHANGED
|
@@ -43,7 +43,7 @@ describe("isValidEmail", () => {
|
|
|
43
43
|
test("Subdomain", () => expect((0, utils_1.isValidEmail)("a@sub.domain.dev")).toBeTruthy());
|
|
44
44
|
test("Subdomain with a dash", () => expect((0, utils_1.isValidEmail)("a@sub.dom-ain.dev")).toBeTruthy());
|
|
45
45
|
test("Long TLD", () => expect((0, utils_1.isValidEmail)("a@b.business")).toBeTruthy());
|
|
46
|
-
test("Diacritics", () => expect((0, utils_1.isValidEmail)("ẞçäöü@
|
|
46
|
+
test("Diacritics", () => expect((0, utils_1.isValidEmail)("ẞçäöü@möręæppß.dev")).toBeTruthy());
|
|
47
47
|
});
|
|
48
48
|
describe("Invalid email addresses", () => {
|
|
49
49
|
test("Missing '@' character and domain", () => expect((0, utils_1.isValidEmail)("john")).toBeFalsy());
|