import { Pipe, PipeTransform } from "@angular/core";

@Pipe({
  name: "protect",
})
export class ProtectPipe implements PipeTransform {
  transform(text?: unknown): string {
    const len = 8;
    if (text && typeof text === "string" && text.length) {
      return "*".repeat(text.length);
    }
    return "*".repeat(len);
  }
}
