git ssb


0+

wanderer / fixed-bn.js



Commit 54003ed769b6485b15e52cfb72a79ab3752cf6b5

added missing deps

wanderer committed on 3/20/2017, 9:31:43 PM
Parent: eef041b670c70bce1e81b245e2ba91145fa81357

Files changed

index.jschanged
package.jsonchanged
index.jsView
@@ -1,5 +1,6 @@
1-const ethUtil = require('ethjs-util')
1+const stripHexPrefix = require('strip-hex-prefix')
2+const isHexPrefixed = require('is-hex-prefixed')
23 const BN = require('bn.js')
34
45 /**
56 * A factory that produces BN.js constructors for a given width
@@ -10,10 +11,10 @@
1011 const factory = module.exports = function factory (maxWidth, minWidth = 0) {
1112 class FixWidth extends BN {
1213 constructor (value) {
1314 // bn.js still doesn't support hex prefixes...
14- if ((typeof value === 'string') && ethUtil.isHexPrefixed(value)) {
15- super(ethUtil.stripHexPrefix(value), 16)
15+ if ((typeof value === 'string') && isHexPrefixed(value)) {
16+ super(stripHexPrefix(value), 16)
1617 } else {
1718 super(value, 10)
1819 }
1920 if (this.bitLength() > maxWidth) {
package.jsonView
@@ -28,7 +28,9 @@
2828 "url": "https://github.com/ewasm/fixed-bn.js/issues"
2929 },
3030 "homepage": "https://github.com/ewasm/fixed-bn.js",
3131 "dependencies": {
32- "bn.js": "^4.11.6"
32+ "bn.js": "^4.11.6",
33+ "is-hex-prefixed": "^1.0.0",
34+ "strip-hex-prefix": "^1.0.0"
3335 }
3436 }

Built with git-ssb-web