high-resolution.ts 384 B

123456789101112131415
  1. import { Pipe, PipeTransform } from "@angular/core";
  2. @Pipe({
  3. name: "highResolution"
  4. })
  5. export class HighResolutionPipe implements PipeTransform {
  6. /**
  7. * Takes a profile img URL string and removes "normal" from the URL to receive a high resolution image
  8. */
  9. transform(value: string, ...args) {
  10. if (value) {
  11. return value.replace("_normal", "_400x400");
  12. }
  13. }
  14. }