Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ethjs-format

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ethjs-format - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

7

CHANGELOG.md

@@ -0,1 +1,8 @@

# 0.1.1 -- removal of BigNumber for BN
1. removal of BigNumber for BN
2. more coverage
3. more docs
4. package fixes, removals
# 0.1.0 -- better coverage

@@ -2,0 +9,0 @@

10

lib/index.js
'use strict';
var schema = require('./schema.json');
var BN = require('bignumber.js');
var schema = require('ethjs-schema');
var BN = require('bn.js');
var toBuffer = require('ethjs-util').toBuffer;

@@ -18,3 +18,3 @@ var stripHexPrefix = require('ethjs-util').stripHexPrefix;

* @param {Boolean} encode to hex or decode to BigNumber
* @returns {Object|String} output to BigNumber or string
* @returns {Optional} output to BigNumber or string
* @throws error if value is a float

@@ -32,6 +32,6 @@ */

if (String(value).match(/[A-Za-z]/i) || String(value).length === 0) {
var prepString = '0x' + toBuffer('0x' + stripHexPrefix(value)).toString('hex'); // eslint-disable-line
var prepString = '' + toBuffer('0x' + stripHexPrefix(value)).toString('hex'); // eslint-disable-line
if (prepString === '0x' || prepString === '') {
prepString = '0x0';
prepString = '0';
}

@@ -38,0 +38,0 @@

@@ -7,3 +7,4 @@ 'use strict';

var format = require('../index.js');
var BN = require('bignumber.js');
var BN = require('bn.js');
var schema = require('ethjs-schema');

@@ -10,0 +11,0 @@ describe('test ethjs-format object', function () {

{
"name": "ethjs-format",
"version": "0.1.0",
"version": "0.1.1",
"description": "A payload formatter for the Ethereum RPC layer.",

@@ -123,3 +123,4 @@ "main": "lib/index.js",

"dependencies": {
"bignumber.js": "3.0.1",
"bn.js": "4.11.6",
"ethjs-schema": "^0.1.0",
"ethjs-util": "0.1.1"

@@ -216,3 +217,3 @@ },

},
"pre-commit": "lint:staged"
"pre-commit": "build"
}

@@ -1,3 +0,3 @@

const schema = require('./schema.json');
const BN = require('bignumber.js');
const schema = require('ethjs-schema');
const BN = require('bn.js');
const toBuffer = require('ethjs-util').toBuffer;

@@ -16,3 +16,3 @@ const stripHexPrefix = require('ethjs-util').stripHexPrefix;

* @param {Boolean} encode to hex or decode to BigNumber
* @returns {Object|String} output to BigNumber or string
* @returns {Optional} output to BigNumber or string
* @throws error if value is a float

@@ -31,6 +31,6 @@ */

if (String(value).match(/[A-Za-z]/i) || String(value).length === 0) {
var prepString = `0x${toBuffer(`0x${stripHexPrefix(value)}`).toString('hex')}`; // eslint-disable-line
var prepString = `${toBuffer(`0x${stripHexPrefix(value)}`).toString('hex')}`; // eslint-disable-line
if (prepString === '0x' || prepString === '') {
prepString = '0x0';
prepString = '0';
}

@@ -37,0 +37,0 @@

@@ -5,3 +5,4 @@ /* eslint-disable */

const format = require('../index.js');
const BN = require('bignumber.js');
const BN = require('bn.js');
const schema = require('ethjs-schema');

@@ -8,0 +9,0 @@ describe('test ethjs-format object', () => {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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