diff --git a/package.json b/package.json index 2bc1642..717ae3a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ztimson/js-utilities", - "version": "0.3.6", + "version": "0.3.7", "description": "JavaScript Utility library", "author": "Zak Timson", "license": "MIT", diff --git a/src/misc.ts b/src/misc.ts index 9040f48..5d6bd00 100644 --- a/src/misc.ts +++ b/src/misc.ts @@ -16,11 +16,12 @@ export function formEncode(data: any): 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) { +export function gravatar(email: string, def='md') { if(!email) return ''; - return `https://www.gravatar.com/avatar/${md5(email)}`; + return `https://www.gravatar.com/avatar/${md5(email)}?d=${def}`; } /** Parts of a URL */