web3-utils
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -380,2 +380,3 @@ /* | ||
toUtf8: utils.hexToUtf8, | ||
stripHexPrefix: utils.stripHexPrefix, | ||
utf8ToHex: utils.utf8ToHex, | ||
@@ -382,0 +383,0 @@ stringToHex: utils.utf8ToHex, |
@@ -339,2 +339,14 @@ /* | ||
/** | ||
* Remove 0x prefix from string | ||
* | ||
* @method stripHexPrefix | ||
* @param {String} str to be checked | ||
* @returns {String} | ||
*/ | ||
var stripHexPrefix = function (str) { | ||
if (str !== 0 && isHex(str)) | ||
return str.replace(/^(-)?0x/i, '$1'); | ||
return str; | ||
}; | ||
/** | ||
* Returns true if given string is a valid Ethereum block header bloom. | ||
@@ -470,2 +482,3 @@ * | ||
isHexStrict: isHexStrict, | ||
stripHexPrefix: stripHexPrefix, | ||
leftPad: leftPad, | ||
@@ -472,0 +485,0 @@ rightPad: rightPad, |
{ | ||
"name": "web3-utils", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Collection of utility functions used in web3.js.", | ||
@@ -30,3 +30,3 @@ "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-utils", | ||
}, | ||
"gitHead": "a88944fff1f62b2b6f00e3de52446d24d9e92cc6" | ||
"gitHead": "1a850aec1d8fa86bfacef1f3ffe71839b87e78e7" | ||
} |
@@ -414,2 +414,3 @@ /* | ||
toUtf8: utils.hexToUtf8, | ||
stripHexPrefix: utils.stripHexPrefix, | ||
@@ -416,0 +417,0 @@ utf8ToHex: utils.utf8ToHex, |
@@ -391,2 +391,14 @@ /* | ||
/** | ||
* Remove 0x prefix from string | ||
* | ||
* @method stripHexPrefix | ||
* @param {String} str to be checked | ||
* @returns {String} | ||
*/ | ||
var stripHexPrefix = function (str) { | ||
if (str !== 0 && isHex(str)) | ||
return str.replace(/^(-)?0x/i, '$1') | ||
return str; | ||
}; | ||
@@ -538,2 +550,3 @@ /** | ||
isHexStrict: isHexStrict, | ||
stripHexPrefix: stripHexPrefix, | ||
leftPad: leftPad, | ||
@@ -540,0 +553,0 @@ rightPad: rightPad, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
161702
4743