import {md5} from './string'; /** * Get profile image from Gravatar * * @param {string} email Account email address * @param {string} def Default image, can be a link or '404', see: https://docs.gravatar.com/general/images/ * @returns {string} Gravatar URL */ export function gravatar(email: string, def='mp') { if(!email) return ''; return `https://www.gravatar.com/avatar/${md5(email)}?d=${def}`; }