ethjs-format
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -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 @@ |
'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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
757587
10451
0
3
13
+ Addedbn.js@4.11.6
+ Addedethjs-schema@^0.1.0
+ Addedbn.js@4.11.6(transitive)
+ Addedethjs-schema@0.1.9(transitive)
- Removedbignumber.js@3.0.1
- Removedbignumber.js@3.0.1(transitive)