Switch back to using upstream email-address library (#998)

This commit is contained in:
Ilya Chesnokov 2019-10-25 14:25:03 +03:00 committed by Daniel Huigens
parent 810b8daab2
commit 528fbfb017
3 changed files with 5 additions and 4 deletions

5
npm-shrinkwrap.json generated
View File

@ -2204,8 +2204,9 @@
} }
}, },
"email-addresses": { "email-addresses": {
"version": "github:openpgpjs/email-addresses#686743c6452b44bafcd06d47db7f36ddf3f3f118", "version": "3.1.0",
"from": "github:openpgpjs/email-addresses#686743c6452b44bafcd06d47db7f36ddf3f3f118", "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz",
"integrity": "sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg==",
"dev": true "dev": true
}, },
"encodeurl": { "encodeurl": {

View File

@ -79,7 +79,7 @@
"seek-bzip": "github:openpgpjs/seek-bzip#6187fc025851d35c4e104a25ea15a10b9b8d6f7d", "seek-bzip": "github:openpgpjs/seek-bzip#6187fc025851d35c4e104a25ea15a10b9b8d6f7d",
"tweetnacl": "github:openpgpjs/tweetnacl-js#1ef755f2b252a3e328ac739848d00e0dad76be2d", "tweetnacl": "github:openpgpjs/tweetnacl-js#1ef755f2b252a3e328ac739848d00e0dad76be2d",
"web-stream-tools": "github:openpgpjs/web-stream-tools#dc4b05e8a272b45819233f3df735423432beacfc", "web-stream-tools": "github:openpgpjs/web-stream-tools#dc4b05e8a272b45819233f3df735423432beacfc",
"email-addresses": "github:openpgpjs/email-addresses#686743c6452b44bafcd06d47db7f36ddf3f3f118" "email-addresses": "3.1.0"
}, },
"dependencies": { "dependencies": {
"asn1.js": "^5.0.0", "asn1.js": "^5.0.0",

View File

@ -677,7 +677,7 @@ export default {
throw new Error('User id string is too long'); throw new Error('User id string is too long');
} }
try { try {
const { name, address: email, comments } = emailAddresses.parseOneAddress(userid); const { name, address: email, comments } = emailAddresses.parseOneAddress({ input: userid, atInDisplayName: true });
return { name, email, comment: comments.replace(/^\(|\)$/g, '') }; return { name, email, comment: comments.replace(/^\(|\)$/g, '') };
} catch(e) { } catch(e) {
throw new Error('Invalid user id format'); throw new Error('Invalid user id format');