Socket
Socket
Sign inDemoInstall

web3-utils

Package Overview
Dependencies
Maintainers
1
Versions
442
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3-utils - npm Package Compare versions

Comparing version 1.0.0-beta.29 to 1.0.0-beta.30

2

package.json
{
"name": "web3-utils",
"namespace": "ethereum",
"version": "1.0.0-beta.29",
"version": "1.0.0-beta.30",
"description": "Collection of utility functions used in web3.js.",

@@ -6,0 +6,0 @@ "repository": "https://github.com/ethereum/web3.js/tree/master/packages/web3-utils",

@@ -259,6 +259,10 @@ /*

var numberToHex = function (value) {
if (!isFinite(value) && !_.isString(value)) {
if (_.isNull(value) || _.isUndefined(value)) {
return value;
}
if (!isFinite(value) && !isHexStrict(value)) {
throw new Error('Given input "'+value+'" is not a number.');
}
var number = toBN(value);

@@ -373,3 +377,3 @@ var result = number.toString(16);

var isHex = function (hex) {
return ((_.isString(hex) || _.isNumber(hex)) && /^(-0x)?(0x)?[0-9a-f]*$/i.test(hex));
return ((_.isString(hex) || _.isNumber(hex)) && /^(-0x|0x)?[0-9a-f]*$/i.test(hex));
};

@@ -376,0 +380,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc