mirror of
https://kevinblog.sytes.net/Code/Jibo-Revival-Group/JiboViteDocs.git
synced 2026-06-16 19:36:20 +00:00
Initalize
This commit is contained in:
17
node_modules/gravatar-url/index.js
generated
vendored
Normal file
17
node_modules/gravatar-url/index.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import md5Hex from 'md5-hex';
|
||||
|
||||
export default function gravatarUrl(identifier, options) {
|
||||
if (!identifier) {
|
||||
throw new Error('Please specify an identifier, such as an email address');
|
||||
}
|
||||
|
||||
if (identifier.includes('@')) {
|
||||
identifier = identifier.toLowerCase().trim();
|
||||
}
|
||||
|
||||
const baseUrl = new URL('https://gravatar.com/avatar/');
|
||||
baseUrl.pathname += md5Hex(identifier);
|
||||
baseUrl.search = new URLSearchParams(options);
|
||||
|
||||
return baseUrl.toString();
|
||||
}
|
||||
Reference in New Issue
Block a user