MCPcopy Index your code
hub / github.com/mailvelope/mailvelope / emailCheck

Function emailCheck

src/modules/keyStore.js:88–101  ·  view source on GitHub ↗
(email, key)

Source from the content-addressed store, hash-verified

86}
87
88function emailCheck(email, key) {
89 email = email.toLowerCase();
90 // escape email before using in regular expression
91 const emailEsc = email.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
92 const emailRegex = new RegExp(`<${emailEsc}>`);
93 const userIds = key.getUserIDs();
94 for (let i = 0; i < userIds.length; i++) {
95 const userId = userIds[i].toLowerCase();
96 if (email === userId || emailRegex.test(userId)) {
97 return true;
98 }
99 }
100 return false;
101}
102
103function keyIdCheck(keyId, key) {
104 if (keyId.length === 16) {

Callers 1

getForAddressMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected