3 var url = require('url');
5 var GITHUB_AVATARS_HOST_RE = /^avatars\d*\.githubusercontent\.com$/;
7 /* Given a avatar url, get the cache buster */
8 module.exports = function extractGravatarVersion(avatarUrl) {
10 var parsed = url.parse(avatarUrl, true, true);
12 if (GITHUB_AVATARS_HOST_RE.test(parsed.hostname)) {
13 return parseInt(parsed.query.v, 10) || undefined;