Skip to content

Commit 3529dde

Browse files
committed
adding trim() before split()
1 parent 9989ea6 commit 3529dde

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/helpers/configValidator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ajv.addFormat('email-with-name', {
1919
validate: (email) => {
2020
// this is Ajv's regex for email format (https://github.com/ajv-validator/ajv-formats/blob/master/src/formats.ts#L106)
2121
const emailRegex = new RegExp(/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i);
22-
return emailRegex.test(email.split(' ').pop());
22+
return emailRegex.test(email.trim().split(' ').pop());
2323
},
2424
});
2525

0 commit comments

Comments
 (0)