New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

biggystring

Package Overview
Dependencies
Maintainers
0
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

biggystring - npm Package Compare versions

Comparing version 4.2.1 to 4.2.2

lib/index.d.ts

5

lib/src/index.js

@@ -188,2 +188,5 @@ "use strict";

let out = typeof n === 'number' ? n.toString() : n.replace(/^\s+|\s+$/g, '');
if (out === '') {
out = '0';
}
// Handle scientific notation

@@ -437,3 +440,3 @@ const match = out.match(SCI_NOTATION_REGEX);

}
if (/[^\d.\-x]/.test(arg)) {
if (!/^-?(?:0x[0-9A-Fa-f]+|(?:\d+(?:\.\d*)?|\.\d+))$/.test(arg)) {
throw new Error(`Invalid number: non-number characters '${arg}'`);

@@ -440,0 +443,0 @@ }

22

lib/test/biggystring.test.js

@@ -45,2 +45,11 @@ "use strict";

});
it('add hex numbers 0xadef0983 + 0xABF09876 = 0x159dfa1f9', function () {
chai_1.assert.equal(index_1.add('0xadef0983', '0xABF09876', 16), '0x159dfa1f9');
});
it(`convert hex to decimal using add: 0xadef0983 + 0 = 2918123907`, function () {
chai_1.assert.equal(index_1.add('0xadef0983', '0', 10), '2918123907');
});
it(`convert decimal to hex using add: 2918123907 + 0 = 0xadef0983`, function () {
chai_1.assert.equal(index_1.add('2918123907', '0', 16), '0xadef0983');
});
});

@@ -89,2 +98,11 @@ describe('sub', function () {

});
it('multiply hex numbers 0xadef0983 * 0xABF09876 = 0x74d2230985a42a62', function () {
chai_1.assert.equal(index_1.mul('0xadef0983', '0xABF09876', 16), '0x74d2230985a42a62');
});
it('convert hex to decimal using mul: 0xadef0983 * 1 = 2918123907', function () {
chai_1.assert.equal(index_1.mul('0xadef0983', '1', 10), '2918123907');
});
it('convert decimal to hex using mul: 2918123907 * 1 = 0xadef0983', function () {
chai_1.assert.equal(index_1.mul('2918123907', '1', 16), '0xadef0983');
});
});

@@ -142,6 +160,6 @@ describe('div', function () {

it('spaces', function () {
chai_1.assert.equal(index_1.toBns(' '), '');
chai_1.assert.equal(index_1.toBns(' '), '0');
});
it('2 spaces', function () {
chai_1.assert.equal(index_1.toBns(' '), '');
chai_1.assert.equal(index_1.toBns(' '), '0');
});

@@ -148,0 +166,0 @@ it('scientific notation: regular numbers', function () {

{
"name": "biggystring",
"version": "4.2.1",
"version": "4.2.2",
"description": "Full floating point big number library using regular Javascript string",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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