mirror of
https://github.com/RocketChat/Rocket.Chat.git
synced 2025-12-28 06:47:25 +00:00
5 lines
242 B
TypeScript
5 lines
242 B
TypeScript
import type { IUser } from '@rocket.chat/core-typings';
|
|
|
|
export const getUserEmailAddress = (user: Pick<IUser, 'emails'>): string | undefined =>
|
|
Array.isArray(user.emails) ? user.emails.find(({ address }) => !!address)?.address : undefined;
|