mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 14:29:45 +00:00
matt comments addressed
This commit is contained in:
committed by
Aiden McClelland
parent
2ed9d09443
commit
bef29fdaf0
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user