jiti-meet/react/features/display-name/functions.ts

13 lines
406 B
TypeScript
Raw Permalink Normal View History

/**
* Appends a suffix to the display name.
*
* @param {string} displayName - The display name.
* @param {string} suffix - Suffix that will be appended.
* @returns {string} The formatted display name.
*/
export function appendSuffix(displayName: string, suffix = ''): string {
return `${displayName || suffix}${
2019-01-13 19:33:28 +00:00
displayName && suffix && displayName !== suffix ? ` (${suffix})` : ''}`;
}