const formatUserDetails = (userDetails) => {
    if (userDetails && Array.isArray(userDetails)) {
        return userDetails.map(({ user }) => ({
            id: user.id,
            name: user.name,
            emailId: user.emailId,
        }));
    }
    return [];
};
const findUserByName = (name, users) => {
    const matchedUser = users.find((user) => `@${user.name.replace(/\s+/g, '')}` === name);
    return matchedUser ? matchedUser.emailId : null;
};

export { findUserByName, formatUserDetails };
//# sourceMappingURL=commentCommonUtils.js.map
