Remove util.isUserId()
It was not really correct anyway; a user id can just be an email address without < > brackets.
This commit is contained in:
parent
fe3c1b4f31
commit
3c224379f6
|
@ -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
|
* Normalize line endings to \r\n
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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() {
|
describe('getTransferables', function() {
|
||||||
let zero_copyVal;
|
let zero_copyVal;
|
||||||
const buf1 = new Uint8Array(1);
|
const buf1 = new Uint8Array(1);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user