Migrate util, types, state, sticker-creator to ESLint

This commit is contained in:
Sidney Keese 2020-09-14 14:56:35 -07:00 committed by Josh Perez
parent 372aa44e49
commit 2ade4acd52
115 changed files with 647 additions and 448 deletions

View file

@ -7,14 +7,14 @@ function removeNonInitials(name: string) {
export function getInitials(name?: string): string | undefined {
if (!name) {
return;
return undefined;
}
const cleaned = removeNonInitials(name);
const parts = cleaned.split(' ');
const initials = parts.map(part => part.trim()[0]);
if (!initials.length) {
return;
return undefined;
}
return initials.slice(0, 2).join('');