matt comments addressed

This commit is contained in:
Drew Ansbacher
2021-12-03 13:57:41 -07:00
committed by Aiden McClelland
parent 2ed9d09443
commit bef29fdaf0
6 changed files with 37 additions and 274 deletions

View File

@@ -20,3 +20,14 @@ export class TruncateEndPipe implements PipeTransform {
return val.slice(0, length) + '...'
}
}
@Pipe({
name: 'truncateTail',
})
export class TruncateTailPipe implements PipeTransform {
transform (val: string, length: number): unknown {
if (val.length <= length) return val
return '...' + val.substr(length * -1)
}
}