Angular custom pipe

by Jithin Raj P R

JavaScript

@Pipe({
  name: 'mask',
  standalone: true,
})

export class MaskPipe implements PipeTransform {
  transform(value: string): string {
    if(!value) return '';
    return `**** ${value.slice(-4)}`
  }
}