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

biggystring

Package Overview
Dependencies
Maintainers
1
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 1.1.9 to 1.1.10

19

lib/index.es.js

@@ -28,8 +28,16 @@ /**

// Remove trailing zeros and decimal
// Remove starting and trailing zeros and decimal
function trimEnd(val) {
// if (val === '0') {
// return val
// }
// Remove starting zeros if there are any
var out = val.replace(/^0+/, '');
out = out.replace(/^\.+/, '0.');
if (out.includes('.')) {
// Remove trailing zeros
out = out.replace(/0+$/, '');
// Remove trailing "." if there is one
out = out.replace(/\.+$/, '');

@@ -40,2 +48,5 @@ if (out === '') {

}
if (out === '') {
out = '0';
}
return out;

@@ -405,3 +416,7 @@ }

if (decimalPos === -1) {
return x + '.' + addZeros('', minPrecision);
var out = x + '.' + addZeros('', minPrecision);
// Remove trailing "." if there is one
out = out.replace(/\.+$/, '');
return out;
} else {

@@ -408,0 +423,0 @@ var numDecimals = x.length - decimalPos - 1;

@@ -32,8 +32,16 @@ 'use strict';

// Remove trailing zeros and decimal
// Remove starting and trailing zeros and decimal
function trimEnd(val) {
// if (val === '0') {
// return val
// }
// Remove starting zeros if there are any
var out = val.replace(/^0+/, '');
out = out.replace(/^\.+/, '0.');
if (out.includes('.')) {
// Remove trailing zeros
out = out.replace(/0+$/, '');
// Remove trailing "." if there is one
out = out.replace(/\.+$/, '');

@@ -44,2 +52,5 @@ if (out === '') {

}
if (out === '') {
out = '0';
}
return out;

@@ -409,3 +420,7 @@ }

if (decimalPos === -1) {
return x + '.' + addZeros('', minPrecision);
var out = x + '.' + addZeros('', minPrecision);
// Remove trailing "." if there is one
out = out.replace(/\.+$/, '');
return out;
} else {

@@ -412,0 +427,0 @@ var numDecimals = x.length - decimalPos - 1;

16

package.json
{
"name": "biggystring",
"version": "1.1.9",
"version": "1.1.10",
"description": "Full floating point big number library using regular Javascript string",

@@ -25,12 +25,10 @@ "keywords": [

"scripts": {
"build": "npm run lint && npm run prepare && npm run build:flow",
"build:flow": "npm run flow && flow-copy-source -v -i '**/test/**' src lib",
"precommit": "npm test",
"cover": "nyc --reporter=lcov --reporter=text --reporter=html --extension .js npm test",
"build": "rollup -c && flow-copy-source -v -i '**/test/**' src lib",
"flow": "flow",
"lint": "standard '*.js' 'src/**/*.js'",
"lint": "standard '*.js' 'src/**/*.js' && npm run flow",
"lint --fix": "standard '*.js' 'src/**/*.js' --fix",
"prepare": "npm run rollup",
"rollup": "rollup -c",
"test": "npm run build && mocha"
"test": "npm run lint && mocha",
"precommit": "npm run build && npm test",
"cover": "nyc --reporter=lcov --reporter=text --reporter=html --extension .js npm test",
"prepare": "npm run build"
},

@@ -37,0 +35,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

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