From 3262315248468582dccd35c241c29f45e88d948a Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sat, 16 May 2020 17:49:59 +0200 Subject: [PATCH] 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 --- lib/letter-avatars.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/letter-avatars.ts b/lib/letter-avatars.ts index 3d038047b..e476ad6bb 100644 --- a/lib/letter-avatars.ts +++ b/lib/letter-avatars.ts @@ -25,9 +25,6 @@ export function generateAvatar (name: string): string { export function generateAvatarURL (name: string, email = '', big = true): string { let photo - if (email.length === 0) { - email = '' + name + '@example.com' - } name = encodeURIComponent(name) const hash = createHash('md5')