This commit is contained in:
Matt Hill
2022-07-27 23:16:28 -06:00
committed by Aiden McClelland
parent 34000fb9f0
commit 43090c9873
3 changed files with 6 additions and 6 deletions

View File

@@ -4,7 +4,8 @@ import { Pipe, PipeTransform } from '@angular/core'
name: 'mask',
})
export class MaskPipe implements PipeTransform {
transform(val: string): string {
return val && '●'.repeat(val.length)
transform(val: string, max?: number): string {
const length = max ? Math.min(max, val.length) : val.length
return '●'.repeat(length)
}
}