Skip to content

v1.4.3

Compare
Choose a tag to compare
@johnson86tw johnson86tw released this 10 May 01:53
· 35 commits to main since this release
  • Update shortenAddress
test('shortenAddress', () => {
	expect(shortenAddress('0x9D75F4EbcB8e7669E59dcc27CBadC698E0F77187')).toBe('0x9D75...7187')
})

test('shortenAddress with custom start and end length', () => {
	expect(shortenAddress('0x9D75F4EbcB8e7669E59dcc27CBadC698E0F77187', 8, 5)).toBe('0x9D75F4...77187')
})

test('shortenAddress with invalid address', () => {
	expect(shortenAddress('')).toBe('')
	expect(shortenAddress(null as any)).toBe('')
	expect(shortenAddress(undefined as any)).toBe('')
})