ngx-gravatar
Advanced tools
Comparing version 9.0.0 to 9.0.1
@@ -267,4 +267,2 @@ (function (global, factory) { | ||
if (this.gravatarConfig) { | ||
this.gravatarConfig.rating = this.determineRating(this.gravatarConfig.rating); | ||
this.gravatarConfig.fallback = this.determineFallback(this.gravatarConfig.fallback); | ||
this.defaultConfig = __assign(__assign({}, this.defaultConfig), this.gravatarConfig); | ||
@@ -289,2 +287,5 @@ } | ||
NgxGravatarService.prototype.generateGravatarUrl = function (email, md5Hash, size, rating, fallback) { | ||
if (size === void 0) { size = this.defaultConfig.size; } | ||
if (rating === void 0) { rating = this.defaultConfig.rating; } | ||
if (fallback === void 0) { fallback = this.defaultConfig.fallback; } | ||
var emailHash; | ||
@@ -304,42 +305,4 @@ if (md5Hash) { | ||
} | ||
size = size ? size : this.defaultConfig.size; | ||
rating = this.determineRating(rating, this.defaultConfig.rating); | ||
fallback = this.determineFallback(fallback, this.defaultConfig.fallback); | ||
return "https://www.gravatar.com/avatar/" + emailHash + "?s=" + size + "&r=" + rating + "&d=" + fallback; | ||
}; | ||
/** | ||
* Determine gravatar fallback string | ||
* @param fallback string | ||
* @param defaultFallback string | ||
* @return string | ||
*/ | ||
NgxGravatarService.prototype.determineFallback = function (fallback, defaultFallback) { | ||
if (defaultFallback === void 0) { defaultFallback = DEFAULT_CONFIG.fallback; } | ||
if (fallback === undefined) { | ||
return defaultFallback; | ||
} | ||
if (exports.FALLBACK[fallback] === undefined) { | ||
// Complain invalid fallback | ||
console.error("[ngx-gravatar] - \"" + fallback + "\" is invalid gravatar fallback type. " + ("Default fallback \"" + defaultFallback + "\" is used.")); | ||
return defaultFallback; | ||
} | ||
return fallback; | ||
}; | ||
/** | ||
* Determine gravatar rating string | ||
* @param rating string | ||
* @param defaultRating string | ||
* @return string | ||
*/ | ||
NgxGravatarService.prototype.determineRating = function (rating, defaultRating) { | ||
if (defaultRating === void 0) { defaultRating = DEFAULT_CONFIG.rating; } | ||
if (rating === undefined) { | ||
return defaultRating; | ||
} | ||
if (exports.RATING[rating] === undefined) { | ||
console.error("[ngx-gravatar] - \"" + rating + "\" is invalid gravatar rating type. " + ("Default rating \"" + defaultRating + "\" is used.")); | ||
return defaultRating; | ||
} | ||
return rating; | ||
}; | ||
NgxGravatarService.ctorParameters = function () { return [ | ||
@@ -346,0 +309,0 @@ { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [GRAVATAR_CONFIG_TOKEN,] }] } |
@@ -15,3 +15,3 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("ts-md5/dist/md5")):"function"==typeof define&&define.amd?define("ngx-gravatar",["exports","@angular/core","ts-md5/dist/md5"],e):e((t=t||self)["ngx-gravatar"]={},t.ng.core,t.md5)}(this,(function(t,e,r){"use strict"; | ||
and limitations under the License. | ||
***************************************************************************** */var i=function(){return(i=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var a in e=arguments[r])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t}).apply(this,arguments)};function a(t,e,r,i){var a,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(n=(o<3?a(n):o>3?a(e,r,n):a(e,r))||n);return o>3&&n&&Object.defineProperty(e,r,n),n}function o(t,e){return function(r,i){e(r,i,t)}}function n(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}var s,d,l=new e.InjectionToken("gravatarCustom.config");(s=t.FALLBACK||(t.FALLBACK={})).blank="blank",s.identicon="identicon",s.mm="mm",s.mp="mp",s.monsterid="monsterid",s.retro="retro",s.robohash="robohash",s.wavatar="wavatar",(d=t.RATING||(t.RATING={})).g="g",d.pg="pg",d.r="r",d.x="x";var u={fallback:t.FALLBACK.retro,size:40,cornerRadius:0,preferGravatar:!1,hasBorder:!1,borderColor:"#000000",borderRadius:"50%",borderStyle:"solid",borderWidth:1,round:!0,backgroundColor:"transparent",rating:t.RATING.g,ratio:2},f=function(){function s(t){this.gravatarConfig=t,this.defaultConfig=i({},u),this.gravatarConfig&&(this.gravatarConfig.rating=this.determineRating(this.gravatarConfig.rating),this.gravatarConfig.fallback=this.determineFallback(this.gravatarConfig.fallback),this.defaultConfig=i(i({},this.defaultConfig),this.gravatarConfig))}return s.prototype.getDefaultConfig=function(){return this.defaultConfig},s.prototype.generateGravatarUrl=function(t,e,i,a,o){var n;if(e)n=e;else{try{t=t.trim().toLowerCase()}catch(e){console.error("[ngx-gravatar] - Email ("+t+") is not a string. Empty string is used as a default email."),t=""}n=r.Md5.hashStr(t)}return"https://www.gravatar.com/avatar/"+n+"?s="+(i=i||this.defaultConfig.size)+"&r="+(a=this.determineRating(a,this.defaultConfig.rating))+"&d="+(o=this.determineFallback(o,this.defaultConfig.fallback))},s.prototype.determineFallback=function(e,r){return void 0===r&&(r=u.fallback),void 0===e?r:void 0===t.FALLBACK[e]?(console.error('[ngx-gravatar] - "'+e+'" is invalid gravatar fallback type. Default fallback "'+r+'" is used.'),r):e},s.prototype.determineRating=function(e,r){return void 0===r&&(r=u.rating),void 0===e?r:void 0===t.RATING[e]?(console.error('[ngx-gravatar] - "'+e+'" is invalid gravatar rating type. Default rating "'+r+'" is used.'),r):e},s.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[l]}]}]},s.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new s(e["ɵɵinject"](l,8))},token:s,providedIn:"root"}),s=a([e.Injectable({providedIn:"root"}),o(0,e.Optional()),o(0,e.Inject(l)),n("design:paramtypes",[Object])],s)}(),p=function(){function t(t,e,r){var i=this;this.elementRef=t,this.renderer=e,this.gravatarService=r,this.style={},this.initialized=!1,this.defaultConfig=this.gravatarService.getDefaultConfig(),this.renderer.listen(this.elementRef.nativeElement,"error",(function(t){i.isGravatarUsed||i.initializeAvatar(!0)}))}return t.prototype.ngOnInit=function(){this.initializeAvatar(),this.initialized=!0,this.isGravatarUsed=!1},t.prototype.ngOnChanges=function(){this.initialized&&this.initializeAvatar()},t.prototype.setDefaultValues=function(){this.size=this.computeSize(),this.ratio=void 0===this.ratio?this.defaultConfig.ratio:this.ratio,this.requestedSize=this.size*this.ratio,this.round=void 0===this.round?this.defaultConfig.round:this.round,this.cornerRadius=void 0===this.cornerRadius?this.defaultConfig.cornerRadius:this.cornerRadius,this.preferGravatar=void 0===this.preferGravatar?this.defaultConfig.preferGravatar:this.preferGravatar},t.prototype.initializeAvatar=function(t){this.setDefaultValues();var e="";this.preferGravatar||t?(e=this.gravatarService.generateGravatarUrl(this.email,this.md5Hash,this.requestedSize,this.rating,this.fallback),this.isGravatarUsed=!0):this.src?e=this.src:(e=this.gravatarService.generateGravatarUrl(this.email,this.md5Hash,this.requestedSize,this.rating,this.fallback),this.isGravatarUsed=!0),this.renderer.setProperty(this.elementRef.nativeElement,"src",e),this.setStyle(this.avatarStyle())},t.prototype.computeSize=function(){var t=void 0===this.size?this.defaultConfig.size:this.size;if(this.style&&this.style.width)try{var e=this.style.width.trim();e.match(/^\d+px$/)&&(t=e.replace("px",""))}catch(e){return t}return t},t.prototype.avatarStyle=function(){var t={width:this.size+"px",height:this.size+"px",borderRadius:this.round?this.defaultConfig.borderRadius:this.cornerRadius+"px",borderStyle:this.defaultConfig.hasBorder||this.borderColor||this.borderWidth?this.defaultConfig.borderStyle:"none",borderColor:this.borderColor?this.borderColor:this.defaultConfig.borderColor,borderWidth:this.borderWidth?this.borderWidth+"px":this.defaultConfig.borderWidth+"px",backgroundColor:this.backgroundColor?this.backgroundColor:this.defaultConfig.backgroundColor};return i(i({},t),this.style)},t.prototype.setStyle=function(t){var e=this;Object.keys(t).forEach((function(r){e.renderer.setStyle(e.elementRef.nativeElement,r,t[r])}))},t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.Renderer2},{type:f}]},a([e.Input(),n("design:type",String)],t.prototype,"src",void 0),a([e.Input(),n("design:type",String)],t.prototype,"email",void 0),a([e.Input(),n("design:type",String)],t.prototype,"md5Hash",void 0),a([e.Input(),n("design:type",Number)],t.prototype,"size",void 0),a([e.Input(),n("design:type",String)],t.prototype,"fallback",void 0),a([e.Input(),n("design:type",String)],t.prototype,"rating",void 0),a([e.Input(),n("design:type",Boolean)],t.prototype,"round",void 0),a([e.Input(),n("design:type",Number)],t.prototype,"cornerRadius",void 0),a([e.Input(),n("design:type",String)],t.prototype,"borderColor",void 0),a([e.Input(),n("design:type",Number)],t.prototype,"borderWidth",void 0),a([e.Input(),n("design:type",Object)],t.prototype,"style",void 0),a([e.Input(),n("design:type",Boolean)],t.prototype,"preferGravatar",void 0),a([e.Input(),n("design:type",Boolean)],t.prototype,"backgroundColor",void 0),a([e.Input(),n("design:type",Number)],t.prototype,"ratio",void 0),t=a([e.Directive({selector:"[ngx-gravatar], [ngxGravatar]"}),n("design:paramtypes",[e.ElementRef,e.Renderer2,f])],t)}(),h=function(){function t(){}var r;return r=t,t.forRoot=function(t){return{ngModule:r,providers:[{provide:l,useValue:t}]}},t=r=a([e.NgModule({declarations:[p],exports:[p]})],t)}();t.GravatarModule=h,t.NgxGravatarService=f,t.ɵa=p,t.ɵb=l,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
***************************************************************************** */var i=function(){return(i=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function o(t,e,r,i){var o,a=arguments.length,n=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(n=(a<3?o(n):a>3?o(e,r,n):o(e,r))||n);return a>3&&n&&Object.defineProperty(e,r,n),n}function a(t,e){return function(r,i){e(r,i,t)}}function n(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}var s,d,u=new e.InjectionToken("gravatarCustom.config");(s=t.FALLBACK||(t.FALLBACK={})).blank="blank",s.identicon="identicon",s.mm="mm",s.mp="mp",s.monsterid="monsterid",s.retro="retro",s.robohash="robohash",s.wavatar="wavatar",(d=t.RATING||(t.RATING={})).g="g",d.pg="pg",d.r="r",d.x="x";var p={fallback:t.FALLBACK.retro,size:40,cornerRadius:0,preferGravatar:!1,hasBorder:!1,borderColor:"#000000",borderRadius:"50%",borderStyle:"solid",borderWidth:1,round:!0,backgroundColor:"transparent",rating:t.RATING.g,ratio:2},f=function(){function t(t){this.gravatarConfig=t,this.defaultConfig=i({},p),this.gravatarConfig&&(this.defaultConfig=i(i({},this.defaultConfig),this.gravatarConfig))}return t.prototype.getDefaultConfig=function(){return this.defaultConfig},t.prototype.generateGravatarUrl=function(t,e,i,o,a){var n;if(void 0===i&&(i=this.defaultConfig.size),void 0===o&&(o=this.defaultConfig.rating),void 0===a&&(a=this.defaultConfig.fallback),e)n=e;else{try{t=t.trim().toLowerCase()}catch(e){console.error("[ngx-gravatar] - Email ("+t+") is not a string. Empty string is used as a default email."),t=""}n=r.Md5.hashStr(t)}return"https://www.gravatar.com/avatar/"+n+"?s="+i+"&r="+o+"&d="+a},t.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[u]}]}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](u,8))},token:t,providedIn:"root"}),t=o([e.Injectable({providedIn:"root"}),a(0,e.Optional()),a(0,e.Inject(u)),n("design:paramtypes",[Object])],t)}(),h=function(){function t(t,e,r){var i=this;this.elementRef=t,this.renderer=e,this.gravatarService=r,this.style={},this.initialized=!1,this.defaultConfig=this.gravatarService.getDefaultConfig(),this.renderer.listen(this.elementRef.nativeElement,"error",(function(t){i.isGravatarUsed||i.initializeAvatar(!0)}))}return t.prototype.ngOnInit=function(){this.initializeAvatar(),this.initialized=!0,this.isGravatarUsed=!1},t.prototype.ngOnChanges=function(){this.initialized&&this.initializeAvatar()},t.prototype.setDefaultValues=function(){this.size=this.computeSize(),this.ratio=void 0===this.ratio?this.defaultConfig.ratio:this.ratio,this.requestedSize=this.size*this.ratio,this.round=void 0===this.round?this.defaultConfig.round:this.round,this.cornerRadius=void 0===this.cornerRadius?this.defaultConfig.cornerRadius:this.cornerRadius,this.preferGravatar=void 0===this.preferGravatar?this.defaultConfig.preferGravatar:this.preferGravatar},t.prototype.initializeAvatar=function(t){this.setDefaultValues();var e="";this.preferGravatar||t?(e=this.gravatarService.generateGravatarUrl(this.email,this.md5Hash,this.requestedSize,this.rating,this.fallback),this.isGravatarUsed=!0):this.src?e=this.src:(e=this.gravatarService.generateGravatarUrl(this.email,this.md5Hash,this.requestedSize,this.rating,this.fallback),this.isGravatarUsed=!0),this.renderer.setProperty(this.elementRef.nativeElement,"src",e),this.setStyle(this.avatarStyle())},t.prototype.computeSize=function(){var t=void 0===this.size?this.defaultConfig.size:this.size;if(this.style&&this.style.width)try{var e=this.style.width.trim();e.match(/^\d+px$/)&&(t=e.replace("px",""))}catch(e){return t}return t},t.prototype.avatarStyle=function(){var t={width:this.size+"px",height:this.size+"px",borderRadius:this.round?this.defaultConfig.borderRadius:this.cornerRadius+"px",borderStyle:this.defaultConfig.hasBorder||this.borderColor||this.borderWidth?this.defaultConfig.borderStyle:"none",borderColor:this.borderColor?this.borderColor:this.defaultConfig.borderColor,borderWidth:this.borderWidth?this.borderWidth+"px":this.defaultConfig.borderWidth+"px",backgroundColor:this.backgroundColor?this.backgroundColor:this.defaultConfig.backgroundColor};return i(i({},t),this.style)},t.prototype.setStyle=function(t){var e=this;Object.keys(t).forEach((function(r){e.renderer.setStyle(e.elementRef.nativeElement,r,t[r])}))},t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.Renderer2},{type:f}]},o([e.Input(),n("design:type",String)],t.prototype,"src",void 0),o([e.Input(),n("design:type",String)],t.prototype,"email",void 0),o([e.Input(),n("design:type",String)],t.prototype,"md5Hash",void 0),o([e.Input(),n("design:type",Number)],t.prototype,"size",void 0),o([e.Input(),n("design:type",String)],t.prototype,"fallback",void 0),o([e.Input(),n("design:type",String)],t.prototype,"rating",void 0),o([e.Input(),n("design:type",Boolean)],t.prototype,"round",void 0),o([e.Input(),n("design:type",Number)],t.prototype,"cornerRadius",void 0),o([e.Input(),n("design:type",String)],t.prototype,"borderColor",void 0),o([e.Input(),n("design:type",Number)],t.prototype,"borderWidth",void 0),o([e.Input(),n("design:type",Object)],t.prototype,"style",void 0),o([e.Input(),n("design:type",Boolean)],t.prototype,"preferGravatar",void 0),o([e.Input(),n("design:type",Boolean)],t.prototype,"backgroundColor",void 0),o([e.Input(),n("design:type",Number)],t.prototype,"ratio",void 0),t=o([e.Directive({selector:"[ngx-gravatar], [ngxGravatar]"}),n("design:paramtypes",[e.ElementRef,e.Renderer2,f])],t)}(),l=function(){function t(){}var r;return r=t,t.forRoot=function(t){return{ngModule:r,providers:[{provide:u,useValue:t}]}},t=r=o([e.NgModule({declarations:[h],exports:[h]})],t)}();t.GravatarModule=l,t.NgxGravatarService=f,t.ɵa=h,t.ɵb=u,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=ngx-gravatar.umd.min.js.map |
@@ -1,2 +0,2 @@ | ||
# v9.0.0 | ||
# v9.0.0 - 9.0.1 | ||
* Upgrade to Angular 9 | ||
@@ -3,0 +3,0 @@ |
@@ -6,3 +6,2 @@ import { __decorate, __metadata, __param } from "tslib"; | ||
import { DEFAULT_CONFIG } from './ngx-gravatar.constants'; | ||
import { FALLBACK, RATING } from './ngx-gravatar.enums'; | ||
import * as i0 from "@angular/core"; | ||
@@ -15,4 +14,2 @@ import * as i1 from "./gravatar-config.token"; | ||
if (this.gravatarConfig) { | ||
this.gravatarConfig.rating = this.determineRating(this.gravatarConfig.rating); | ||
this.gravatarConfig.fallback = this.determineFallback(this.gravatarConfig.fallback); | ||
this.defaultConfig = Object.assign(Object.assign({}, this.defaultConfig), this.gravatarConfig); | ||
@@ -36,3 +33,3 @@ } | ||
*/ | ||
generateGravatarUrl(email, md5Hash, size, rating, fallback) { | ||
generateGravatarUrl(email, md5Hash, size = this.defaultConfig.size, rating = this.defaultConfig.rating, fallback = this.defaultConfig.fallback) { | ||
let emailHash; | ||
@@ -52,40 +49,4 @@ if (md5Hash) { | ||
} | ||
size = size ? size : this.defaultConfig.size; | ||
rating = this.determineRating(rating, this.defaultConfig.rating); | ||
fallback = this.determineFallback(fallback, this.defaultConfig.fallback); | ||
return `https://www.gravatar.com/avatar/${emailHash}?s=${size}&r=${rating}&d=${fallback}`; | ||
} | ||
/** | ||
* Determine gravatar fallback string | ||
* @param fallback string | ||
* @param defaultFallback string | ||
* @return string | ||
*/ | ||
determineFallback(fallback, defaultFallback = DEFAULT_CONFIG.fallback) { | ||
if (fallback === undefined) { | ||
return defaultFallback; | ||
} | ||
if (FALLBACK[fallback] === undefined) { | ||
// Complain invalid fallback | ||
console.error(`[ngx-gravatar] - "${fallback}" is invalid gravatar fallback type. ` + `Default fallback "${defaultFallback}" is used.`); | ||
return defaultFallback; | ||
} | ||
return fallback; | ||
} | ||
/** | ||
* Determine gravatar rating string | ||
* @param rating string | ||
* @param defaultRating string | ||
* @return string | ||
*/ | ||
determineRating(rating, defaultRating = DEFAULT_CONFIG.rating) { | ||
if (rating === undefined) { | ||
return defaultRating; | ||
} | ||
if (RATING[rating] === undefined) { | ||
console.error(`[ngx-gravatar] - "${rating}" is invalid gravatar rating type. ` + `Default rating "${defaultRating}" is used.`); | ||
return defaultRating; | ||
} | ||
return rating; | ||
} | ||
}; | ||
@@ -104,2 +65,2 @@ NgxGravatarService.ctorParameters = () => [ | ||
export { NgxGravatarService }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWdyYXZhdGFyLnNlcnZpY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3g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ICAgICAgICBjb25zb2xlLmVycm9yKGBbbmd4LWdyYXZhdGFyXSAtIEVtYWlsICgke2VtYWlsfSkgaXMgbm90IGEgc3RyaW5nLiBFbXB0eSBzdHJpbmcgaXMgdXNlZCBhcyBhIGRlZmF1bHQgZW1haWwuYCk7XG4gICAgICAgIGVtYWlsID0gJyc7XG4gICAgICB9XG4gICAgICBlbWFpbEhhc2ggPSBNZDUuaGFzaFN0cihlbWFpbCk7XG4gICAgfVxuICAgIHJldHVybiBgaHR0cHM6Ly93d3cuZ3JhdmF0YXIuY29tL2F2YXRhci8ke2VtYWlsSGFzaH0/cz0ke3NpemV9JnI9JHtyYXRpbmd9JmQ9JHtmYWxsYmFja31gO1xuICB9XG59XG4iXX0= |
@@ -6,3 +6,2 @@ import { __assign, __decorate, __metadata, __param } from "tslib"; | ||
import { DEFAULT_CONFIG } from './ngx-gravatar.constants'; | ||
import { FALLBACK, RATING } from './ngx-gravatar.enums'; | ||
import * as i0 from "@angular/core"; | ||
@@ -15,4 +14,2 @@ import * as i1 from "./gravatar-config.token"; | ||
if (this.gravatarConfig) { | ||
this.gravatarConfig.rating = this.determineRating(this.gravatarConfig.rating); | ||
this.gravatarConfig.fallback = this.determineFallback(this.gravatarConfig.fallback); | ||
this.defaultConfig = __assign(__assign({}, this.defaultConfig), this.gravatarConfig); | ||
@@ -37,2 +34,5 @@ } | ||
NgxGravatarService.prototype.generateGravatarUrl = function (email, md5Hash, size, rating, fallback) { | ||
if (size === void 0) { size = this.defaultConfig.size; } | ||
if (rating === void 0) { rating = this.defaultConfig.rating; } | ||
if (fallback === void 0) { fallback = this.defaultConfig.fallback; } | ||
var emailHash; | ||
@@ -52,42 +52,4 @@ if (md5Hash) { | ||
} | ||
size = size ? size : this.defaultConfig.size; | ||
rating = this.determineRating(rating, this.defaultConfig.rating); | ||
fallback = this.determineFallback(fallback, this.defaultConfig.fallback); | ||
return "https://www.gravatar.com/avatar/" + emailHash + "?s=" + size + "&r=" + rating + "&d=" + fallback; | ||
}; | ||
/** | ||
* Determine gravatar fallback string | ||
* @param fallback string | ||
* @param defaultFallback string | ||
* @return string | ||
*/ | ||
NgxGravatarService.prototype.determineFallback = function (fallback, defaultFallback) { | ||
if (defaultFallback === void 0) { defaultFallback = DEFAULT_CONFIG.fallback; } | ||
if (fallback === undefined) { | ||
return defaultFallback; | ||
} | ||
if (FALLBACK[fallback] === undefined) { | ||
// Complain invalid fallback | ||
console.error("[ngx-gravatar] - \"" + fallback + "\" is invalid gravatar fallback type. " + ("Default fallback \"" + defaultFallback + "\" is used.")); | ||
return defaultFallback; | ||
} | ||
return fallback; | ||
}; | ||
/** | ||
* Determine gravatar rating string | ||
* @param rating string | ||
* @param defaultRating string | ||
* @return string | ||
*/ | ||
NgxGravatarService.prototype.determineRating = function (rating, defaultRating) { | ||
if (defaultRating === void 0) { defaultRating = DEFAULT_CONFIG.rating; } | ||
if (rating === undefined) { | ||
return defaultRating; | ||
} | ||
if (RATING[rating] === undefined) { | ||
console.error("[ngx-gravatar] - \"" + rating + "\" is invalid gravatar rating type. " + ("Default rating \"" + defaultRating + "\" is used.")); | ||
return defaultRating; | ||
} | ||
return rating; | ||
}; | ||
NgxGravatarService.ctorParameters = function () { return [ | ||
@@ -107,2 +69,2 @@ { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [GRAVATAR_CONFIG_TOKEN,] }] } | ||
export { NgxGravatarService }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWdyYXZhdGFyLnNlcnZpY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtZ3JhdmF0YXIvIiwic291cmNlcyI6WyJsaWIvbmd4LWdyYXZhdGFyLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFrQixRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDN0UsT0FBTyxFQ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bbmd4LWdyYXZhdGFyXSAtIEVtYWlsICgke2VtYWlsfSkgaXMgbm90IGEgc3RyaW5nLiBFbXB0eSBzdHJpbmcgaXMgdXNlZCBhcyBhIGRlZmF1bHQgZW1haWwuYCk7XG4gICAgICAgIGVtYWlsID0gJyc7XG4gICAgICB9XG4gICAgICBlbWFpbEhhc2ggPSBNZDUuaGFzaFN0cihlbWFpbCk7XG4gICAgfVxuICAgIHJldHVybiBgaHR0cHM6Ly93d3cuZ3JhdmF0YXIuY29tL2F2YXRhci8ke2VtYWlsSGFzaH0/cz0ke3NpemV9JnI9JHtyYXRpbmd9JmQ9JHtmYWxsYmFja31gO1xuICB9XG59XG4iXX0= |
@@ -51,4 +51,2 @@ import { __decorate, __param, __metadata } from 'tslib'; | ||
if (this.gravatarConfig) { | ||
this.gravatarConfig.rating = this.determineRating(this.gravatarConfig.rating); | ||
this.gravatarConfig.fallback = this.determineFallback(this.gravatarConfig.fallback); | ||
this.defaultConfig = Object.assign(Object.assign({}, this.defaultConfig), this.gravatarConfig); | ||
@@ -72,3 +70,3 @@ } | ||
*/ | ||
generateGravatarUrl(email, md5Hash, size, rating, fallback) { | ||
generateGravatarUrl(email, md5Hash, size = this.defaultConfig.size, rating = this.defaultConfig.rating, fallback = this.defaultConfig.fallback) { | ||
let emailHash; | ||
@@ -88,40 +86,4 @@ if (md5Hash) { | ||
} | ||
size = size ? size : this.defaultConfig.size; | ||
rating = this.determineRating(rating, this.defaultConfig.rating); | ||
fallback = this.determineFallback(fallback, this.defaultConfig.fallback); | ||
return `https://www.gravatar.com/avatar/${emailHash}?s=${size}&r=${rating}&d=${fallback}`; | ||
} | ||
/** | ||
* Determine gravatar fallback string | ||
* @param fallback string | ||
* @param defaultFallback string | ||
* @return string | ||
*/ | ||
determineFallback(fallback, defaultFallback = DEFAULT_CONFIG.fallback) { | ||
if (fallback === undefined) { | ||
return defaultFallback; | ||
} | ||
if (FALLBACK[fallback] === undefined) { | ||
// Complain invalid fallback | ||
console.error(`[ngx-gravatar] - "${fallback}" is invalid gravatar fallback type. ` + `Default fallback "${defaultFallback}" is used.`); | ||
return defaultFallback; | ||
} | ||
return fallback; | ||
} | ||
/** | ||
* Determine gravatar rating string | ||
* @param rating string | ||
* @param defaultRating string | ||
* @return string | ||
*/ | ||
determineRating(rating, defaultRating = DEFAULT_CONFIG.rating) { | ||
if (rating === undefined) { | ||
return defaultRating; | ||
} | ||
if (RATING[rating] === undefined) { | ||
console.error(`[ngx-gravatar] - "${rating}" is invalid gravatar rating type. ` + `Default rating "${defaultRating}" is used.`); | ||
return defaultRating; | ||
} | ||
return rating; | ||
} | ||
}; | ||
@@ -128,0 +90,0 @@ NgxGravatarService.ctorParameters = () => [ |
@@ -51,4 +51,2 @@ import { __assign, __decorate, __param, __metadata } from 'tslib'; | ||
if (this.gravatarConfig) { | ||
this.gravatarConfig.rating = this.determineRating(this.gravatarConfig.rating); | ||
this.gravatarConfig.fallback = this.determineFallback(this.gravatarConfig.fallback); | ||
this.defaultConfig = __assign(__assign({}, this.defaultConfig), this.gravatarConfig); | ||
@@ -73,2 +71,5 @@ } | ||
NgxGravatarService.prototype.generateGravatarUrl = function (email, md5Hash, size, rating, fallback) { | ||
if (size === void 0) { size = this.defaultConfig.size; } | ||
if (rating === void 0) { rating = this.defaultConfig.rating; } | ||
if (fallback === void 0) { fallback = this.defaultConfig.fallback; } | ||
var emailHash; | ||
@@ -88,42 +89,4 @@ if (md5Hash) { | ||
} | ||
size = size ? size : this.defaultConfig.size; | ||
rating = this.determineRating(rating, this.defaultConfig.rating); | ||
fallback = this.determineFallback(fallback, this.defaultConfig.fallback); | ||
return "https://www.gravatar.com/avatar/" + emailHash + "?s=" + size + "&r=" + rating + "&d=" + fallback; | ||
}; | ||
/** | ||
* Determine gravatar fallback string | ||
* @param fallback string | ||
* @param defaultFallback string | ||
* @return string | ||
*/ | ||
NgxGravatarService.prototype.determineFallback = function (fallback, defaultFallback) { | ||
if (defaultFallback === void 0) { defaultFallback = DEFAULT_CONFIG.fallback; } | ||
if (fallback === undefined) { | ||
return defaultFallback; | ||
} | ||
if (FALLBACK[fallback] === undefined) { | ||
// Complain invalid fallback | ||
console.error("[ngx-gravatar] - \"" + fallback + "\" is invalid gravatar fallback type. " + ("Default fallback \"" + defaultFallback + "\" is used.")); | ||
return defaultFallback; | ||
} | ||
return fallback; | ||
}; | ||
/** | ||
* Determine gravatar rating string | ||
* @param rating string | ||
* @param defaultRating string | ||
* @return string | ||
*/ | ||
NgxGravatarService.prototype.determineRating = function (rating, defaultRating) { | ||
if (defaultRating === void 0) { defaultRating = DEFAULT_CONFIG.rating; } | ||
if (rating === undefined) { | ||
return defaultRating; | ||
} | ||
if (RATING[rating] === undefined) { | ||
console.error("[ngx-gravatar] - \"" + rating + "\" is invalid gravatar rating type. " + ("Default rating \"" + defaultRating + "\" is used.")); | ||
return defaultRating; | ||
} | ||
return rating; | ||
}; | ||
NgxGravatarService.ctorParameters = function () { return [ | ||
@@ -130,0 +93,0 @@ { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [GRAVATAR_CONFIG_TOKEN,] }] } |
@@ -20,16 +20,2 @@ import { GravatarConfig } from './gravatar-config'; | ||
generateGravatarUrl(email: string, md5Hash?: string, size?: number, rating?: string, fallback?: string): string; | ||
/** | ||
* Determine gravatar fallback string | ||
* @param fallback string | ||
* @param defaultFallback string | ||
* @return string | ||
*/ | ||
private determineFallback; | ||
/** | ||
* Determine gravatar rating string | ||
* @param rating string | ||
* @param defaultRating string | ||
* @return string | ||
*/ | ||
private determineRating; | ||
} |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"GravatarModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"ɵa"}],"exports":[{"__symbolic":"reference","name":"ɵa"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":["gravatarConfig"],"value":{"ngModule":{"__symbolic":"reference","name":"GravatarModule"},"providers":[{"provide":{"__symbolic":"reference","name":"ɵb"},"useValue":{"__symbolic":"reference","name":"gravatarConfig"}}]}}}},"GravatarConfig":{"__symbolic":"interface"},"NgxGravatarService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":7,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":13,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":13,"character":27},"arguments":[{"__symbolic":"reference","name":"ɵb"}]}]],"parameters":[{"__symbolic":"reference","name":"GravatarConfig"}]}],"getDefaultConfig":[{"__symbolic":"method"}],"generateGravatarUrl":[{"__symbolic":"method"}],"determineFallback":[{"__symbolic":"method"}],"determineRating":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}},"FALLBACK":{"blank":"blank","identicon":"identicon","mm":"mm","mp":"mp","monsterid":"monsterid","retro":"retro","robohash":"robohash","wavatar":"wavatar"},"RATING":{"g":"g","pg":"pg","r":"r","x":"x"},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":4,"character":1},"arguments":[{"selector":"[ngx-gravatar], [ngxGravatar]"}]}],"members":{"src":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":8,"character":3}}]}],"email":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":3}}]}],"md5Hash":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"fallback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"rating":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"round":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"cornerRadius":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":3}}]}],"borderColor":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":16,"character":3}}]}],"borderWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}}]}],"style":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":3}}]}],"preferGravatar":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":3}}]}],"backgroundColor":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":3}}]}],"ratio":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":28,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":28,"character":64},{"__symbolic":"reference","name":"NgxGravatarService"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"setDefaultValues":[{"__symbolic":"method"}],"initializeAvatar":[{"__symbolic":"method"}],"computeSize":[{"__symbolic":"method"}],"avatarStyle":[{"__symbolic":"method"}],"setStyle":[{"__symbolic":"method"}]}},"ɵb":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":6,"character":41},"arguments":["gravatarCustom.config"]}},"origins":{"GravatarModule":"./lib/gravatar.module","GravatarConfig":"./lib/gravatar-config","NgxGravatarService":"./lib/ngx-gravatar.service","FALLBACK":"./lib/ngx-gravatar.enums","RATING":"./lib/ngx-gravatar.enums","ɵa":"./lib/ngx-gravatar.directive","ɵb":"./lib/gravatar-config.token"},"importAs":"ngx-gravatar"} | ||
{"__symbolic":"module","version":4,"metadata":{"GravatarModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"ɵa"}],"exports":[{"__symbolic":"reference","name":"ɵa"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":["gravatarConfig"],"value":{"ngModule":{"__symbolic":"reference","name":"GravatarModule"},"providers":[{"provide":{"__symbolic":"reference","name":"ɵb"},"useValue":{"__symbolic":"reference","name":"gravatarConfig"}}]}}}},"GravatarConfig":{"__symbolic":"interface"},"NgxGravatarService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":6,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":12,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":12,"character":27},"arguments":[{"__symbolic":"reference","name":"ɵb"}]}]],"parameters":[{"__symbolic":"reference","name":"GravatarConfig"}]}],"getDefaultConfig":[{"__symbolic":"method"}],"generateGravatarUrl":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}},"FALLBACK":{"blank":"blank","identicon":"identicon","mm":"mm","mp":"mp","monsterid":"monsterid","retro":"retro","robohash":"robohash","wavatar":"wavatar"},"RATING":{"g":"g","pg":"pg","r":"r","x":"x"},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":4,"character":1},"arguments":[{"selector":"[ngx-gravatar], [ngxGravatar]"}]}],"members":{"src":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":8,"character":3}}]}],"email":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":3}}]}],"md5Hash":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"fallback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"rating":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"round":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"cornerRadius":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":3}}]}],"borderColor":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":16,"character":3}}]}],"borderWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}}]}],"style":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":3}}]}],"preferGravatar":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":3}}]}],"backgroundColor":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":3}}]}],"ratio":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":28,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":28,"character":64},{"__symbolic":"reference","name":"NgxGravatarService"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"setDefaultValues":[{"__symbolic":"method"}],"initializeAvatar":[{"__symbolic":"method"}],"computeSize":[{"__symbolic":"method"}],"avatarStyle":[{"__symbolic":"method"}],"setStyle":[{"__symbolic":"method"}]}},"ɵb":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":6,"character":41},"arguments":["gravatarCustom.config"]}},"origins":{"GravatarModule":"./lib/gravatar.module","GravatarConfig":"./lib/gravatar-config","NgxGravatarService":"./lib/ngx-gravatar.service","FALLBACK":"./lib/ngx-gravatar.enums","RATING":"./lib/ngx-gravatar.enums","ɵa":"./lib/ngx-gravatar.directive","ɵb":"./lib/gravatar-config.token"},"importAs":"ngx-gravatar"} |
{ | ||
"name": "ngx-gravatar", | ||
"description": "A customizable Gravatar for Angular 4, 5, 6, 7 and 8+ applications - AoT compatible. It supports custom image and Gravatar sources", | ||
"version": "9.0.0", | ||
"description": "A customizable Gravatar for Angular applications.", | ||
"version": "9.0.1", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
[![npm version](https://img.shields.io/npm/v/ngx-gravatar)](https://www.npmjs.com/package/ngx-gravatar) | ||
[![GitHub stars](https://img.shields.io/github/stars/t-ho/ngx-gravatar?color=00bcd4)](https://github.com/t-ho/ngx-gravatar/stargazers) | ||
[![Build Status](https://travis-ci.org/t-ho/ngx-gravatar.svg?branch=master)](https://travis-ci.org/t-ho/ngx-gravatar) | ||
[![codecov](https://codecov.io/gh/t-ho/ngx-gravatar/branch/master/graph/badge.svg)](https://codecov.io/gh/t-ho/ngx-gravatar) | ||
[![npm](https://img.shields.io/npm/dt/ngx-gravatar.svg)](https://www.npmjs.com/package/ngx-gravatar) | ||
[![npm](https://img.shields.io/badge/dynamic/json.svg?label=downloads&url=https%3A%2F%2Fapi.npmjs.org%2Fdownloads%2Fpoint%2Flast-week%2Fngx-gravatar&query=%24.downloads&colorB=bightgreen&suffix=%2Fweek)](https://www.npmjs.com/package/ngx-gravatar) | ||
[![npm](https://img.shields.io/npm/dw/ngx-gravatar.svg)](https://www.npmjs.com/package/ngx-gravatar) | ||
[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/ngx-gravatar.svg)](https://bundlephobia.com/result?p=ngx-gravatar) | ||
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier) | ||
[![npm](https://img.shields.io/npm/l/ngx-gravatar.svg)](https://www.npmjs.com/package/ngx-gravatar) | ||
[![license](https://img.shields.io/npm/l/ngx-gravatar.svg)](https://github.com/t-ho/ngx-gravatar/blob/master/LICENSE) | ||
# ngx-gravatar | ||
The gravatar directive for angular 4+. | ||
The gravatar directive for Angular applications. | ||
@@ -21,3 +21,3 @@ This directive supports two avatar sources: | ||
[![Angular Gravatar Directive](https://github.com/t-ho/ngx-gravatar/blob/assets/src/assets/demo.png?raw=true)](https://tdev.app/ngx-gravatar/demo) | ||
[![Angular Gravatar Directive](https://github.com/t-ho/ngx-gravatar/raw/assets/src/assets/demo.png)](https://tdev.app/ngx-gravatar/demo) | ||
@@ -24,0 +24,0 @@ Visit [here](https://en.gravatar.com/) for more information about Gravatar. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
239945
1908