session-desktop/ts/util/getInitials.ts

12 lines
208 B
TypeScript
Raw Normal View History

2019-01-14 22:49:58 +01:00
export function getInitials(name?: string): string | undefined {
if (!name || !name.length) {
2019-01-14 22:49:58 +01:00
return;
}
if (name.length > 2 && name.startsWith('05')) {
return name[2];
}
return name[0];
}