Skip to content

Commit

Permalink
stripHexPrefix updated for upper case hex prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
nivida committed Aug 2, 2019
1 parent ed43b7f commit 67f7aca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/web3-utils/src/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

/**
Expand Down

0 comments on commit 67f7aca

Please sign in to comment.