From 3c224379f6606730dd66c59fe038eefdb3bd986b Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Fri, 27 Apr 2018 18:47:16 +0200 Subject: [PATCH] Remove util.isUserId() It was not really correct anyway; a user id can just be an email address without < > brackets. --- src/util.js | 7 ------- test/general/util.js | 31 ------------------------------- 2 files changed, 38 deletions(-) diff --git a/src/util.js b/src/util.js index 4cca968a..0b7fff83 100644 --- a/src/util.js +++ b/src/util.js @@ -594,13 +594,6 @@ export default { } }, - isUserId: function(data) { - if (!util.isString(data)) { - return false; - } - return /$/.test(data); - }, - /** * Normalize line endings to \r\n */ diff --git a/test/general/util.js b/test/general/util.js index bcc96f8c..cb0b4daf 100644 --- a/test/general/util.js +++ b/test/general/util.js @@ -116,37 +116,6 @@ describe('Util unit tests', function() { }); }); - describe('isUserId', function() { - it('should return true for valid user id', function() { - const data = 'Test User '; - expect(openpgp.util.isUserId(data)).to.be.true; - }); - it('should return false for invalid user id', function() { - const data = 'Test User test@example.com>'; - expect(openpgp.util.isUserId(data)).to.be.false; - }); - it('should return false for invalid user id', function() { - const data = 'Test User