Skip to content

Commit a00c580

Browse files
fix: replace substr by substring
Co-authored-by: pjt <26487010+PierreJeanjacquot@users.noreply.github.com>
1 parent 3f005ae commit a00c580

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/format.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { multiaddr } from '@multiformats/multiaddr';
22

33
export const multiaddrHexToHuman = (hexString: string): string => {
4-
if (hexString.substr(0, 2) !== '0x') return hexString;
4+
if (hexString.substring(0, 2) !== '0x') return hexString;
55
let res: string;
6-
const buffer: Buffer = Buffer.from(hexString.substr(2), 'hex');
6+
const buffer: Buffer = Buffer.from(hexString.substring(2), 'hex');
77
try {
88
res = multiaddr(new Uint8Array(buffer)).toString();
99
} catch {

0 commit comments

Comments
 (0)