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) && />$/.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 <test@example.com>'; - 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 <test@example.com'; - expect(openpgp.util.isUserId(data)).to.be.false; - }); - 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 empty string', function() { - const data = ''; - expect(openpgp.util.isUserId(data)).to.be.false; - }); - it('should return false for undefined', function() { - let data; - expect(openpgp.util.isUserId(data)).to.be.false; - }); - it('should return false for Object', function() { - const data = {}; - expect(openpgp.util.isUserId(data)).to.be.false; - }); - }); - describe('getTransferables', function() { let zero_copyVal; const buf1 = new Uint8Array(1);