import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ standalone: true, name: 'userNameInitials', }) export class UserNameInitialsPipe implements PipeTransform { transform(userName: string): string { if( !userName ) return ""; return userName .split(' ') .map((word) => word[0]) .join(''); } }