From 67f7aca1f8f79978ad66e3a445feff5f3381db5b Mon Sep 17 00:00:00 2001 From: nivida Date: Fri, 2 Aug 2019 12:28:48 +0200 Subject: [PATCH] stripHexPrefix updated for upper case hex prefix --- packages/web3-utils/src/Utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/web3-utils/src/Utils.js b/packages/web3-utils/src/Utils.js index fc50cf66ee3..9e52e547cea 100644 --- a/packages/web3-utils/src/Utils.js +++ b/packages/web3-utils/src/Utils.js @@ -118,12 +118,12 @@ export const isAddress = (address, chainId = null) => { * * @method stripHexPrefix * - * @param {string} address + * @param {string} string * * @returns {string} address without prefix */ export const stripHexPrefix = (string) => { - return string.slice(0, 2) === '0x' ? string.slice(2) : string; + return string.startsWith('0x') || string.startsWith('0X') ? string.slice(2) : string; }; /**