Comparing version 1.1.1 to 1.1.2
@@ -83,2 +83,5 @@ /** | ||
} | ||
if (out === '') { | ||
out = '0'; | ||
} | ||
return out; | ||
@@ -85,0 +88,0 @@ } |
{ | ||
"name": "hex2dec", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Arbitrary precision decimal/hexadecimal converter.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# hex2dec | ||
[![Latest NPM release](https://img.shields.io/npm/v/hex2dec.svg)](https://www.npmjs.com/package/hex2dec) | ||
[![Minzipped size](https://badgen.net/bundlephobia/minzip/hex2dec)](https://bundlephobia.com/result?p=hex2dec) | ||
[![License](https://img.shields.io/npm/l/hex2dec.svg)](https://github.com/donmccurdy/hex2dec/blob/master/LICENSE) | ||
[![Build Status](https://travis-ci.com/donmccurdy/hex2dec.svg?branch=master)](https://travis-ci.com/donmccurdy/hex2dec) | ||
Arbitrary precision decimal↔️hexadecimal converter, from a [blog post](http://www.danvk.org/hex2dec.html) by [Dan Vanderkam](https://github.com/danvk). Supports positive integer values. | ||
Arbitrary precision decimal↔️hexadecimal converter, from a [blog post](http://www.danvk.org/hex2dec.html) by [Dan Vanderkam](https://github.com/danvk). Supports non-negative integer values. | ||
@@ -9,0 +10,0 @@ ## Usage |
@@ -9,2 +9,3 @@ var chai = require('chai'), | ||
expect(util.hexToDec('0xFA')).to.equal('250'); | ||
expect(util.hexToDec('0x0')).to.equal('0'); | ||
}); | ||
@@ -18,2 +19,3 @@ | ||
expect(util.decToHex('57')).to.equal('0x39'); | ||
expect(util.decToHex('0')).to.equal('0x0'); | ||
}); | ||
@@ -20,0 +22,0 @@ |
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
17763
118
31