Fix generateAvatarURL

Previously, we checked for `typeof email !== 'string'`. This code got turned into `email.length === 0`, which changed the behaviour of the method.
Because TypeScript makes sure that `email` is always a string, we can get rid of the check altogether.

Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
David Mehren 2020-05-16 17:49:59 +02:00
parent 08655f06f9
commit 3262315248
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB

View file

@ -25,9 +25,6 @@ export function generateAvatar (name: string): string {
export function generateAvatarURL (name: string, email = '', big = true): string { export function generateAvatarURL (name: string, email = '', big = true): string {
let photo let photo
if (email.length === 0) {
email = '' + name + '@example.com'
}
name = encodeURIComponent(name) name = encodeURIComponent(name)
const hash = createHash('md5') const hash = createHash('md5')