Allow CTRL F an address on the transaction list component

This commit is contained in:
nymkappa
2022-05-16 16:50:42 +02:00
parent e63aaedbc0
commit 9be6f80cb9
5 changed files with 36 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'capAddress' })
export class CapAddressPipe implements PipeTransform {
transform(str: string, cap: number, leftover: number) {
if (!str) { return; }
if (str.length <= cap) {
return str;
}
return str.slice(-Math.max(cap - str.length, leftover));
}
}