Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / packages / shared / lib / contacts / contactEmail.ts
blobac78ee1d6f78d41632135cee82233a6f06740261
1 import { normalize } from '@proton/shared/lib/helpers/string';
3 export const getContactDisplayNameEmail = ({
4     name,
5     email,
6     emailDelimiters = ['<', '>'],
7 }: {
8     name?: string;
9     email: string;
10     emailDelimiters?: string[];
11 }) => {
12     const displayOnlyEmail = !name || normalize(name) === normalize(email);
13     const nameEmail = displayOnlyEmail ? email : `${name} ${emailDelimiters[0]}${email}${emailDelimiters[1]}`;
15     return {
16         nameEmail,
17         displayOnlyEmail,
18     };