UNPKG

@tapsellorg/angular-material-library

Version:

Angular library for Tapsell

47 lines (42 loc) 2.31 kB
import * as i0 from '@angular/core'; import { Pipe, NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { Md5 } from 'ts-md5'; class PghGravatarPipe { constructor() { this.DEFAULT_AVATAR_URL = 'mp'; } transform(email, size = 80) { if (!email) return; const hash = Md5.hashStr(email.trim().toLowerCase()); return `https://www.gravatar.com/avatar/${hash}.jpg?default=${encodeURIComponent(this.DEFAULT_AVATAR_URL)}&s=${size}`; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: PghGravatarPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); } static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.13", ngImport: i0, type: PghGravatarPipe, isStandalone: false, name: "pghGravatar" }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: PghGravatarPipe, decorators: [{ type: Pipe, args: [{ name: 'pghGravatar', standalone: false, }] }] }); class PghGravatarModule { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: PghGravatarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.13", ngImport: i0, type: PghGravatarModule, declarations: [PghGravatarPipe], imports: [CommonModule], exports: [PghGravatarPipe] }); } static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: PghGravatarModule, imports: [CommonModule] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: PghGravatarModule, decorators: [{ type: NgModule, args: [{ declarations: [PghGravatarPipe], imports: [CommonModule], exports: [PghGravatarPipe], }] }] }); /** * Generated bundle index. Do not edit. */ export { PghGravatarModule, PghGravatarPipe }; //# sourceMappingURL=tapsellorg-angular-material-library-src-lib-gravatar.mjs.map