Skip to content

Commit

Permalink
Merge pull request #36 from zynapse-tech/patch-1
Browse files Browse the repository at this point in the history
Update trim.ts
  • Loading branch information
fran-ink authored Nov 25, 2024
2 parents 18467ec + ac7d52e commit 01ab9aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util/trim.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Address } from "viem";

export const trimAddress = (address?: Address) => {
return address ? `${address.slice(0, 6)}...${address.slice(-4)}` : "";
if (!address || address.length < 10) return "";
return `${address.slice(0, 6)}...${address.slice(-4)}`;
};

0 comments on commit 01ab9aa

Please sign in to comment.