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

better-bytes

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-bytes - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

12

dist/index.js

@@ -75,16 +75,12 @@ var __defProp = Object.defineProperty;

}
if (NUMBER_REG.test(data)) {
const floatValue2 = Number.parseFloat(data);
if (!Number.isFinite(floatValue2) || floatValue2 < 0) {
return null;
}
return Math.floor(floatValue2);
}
const { forceKilobinary = false } = options;
const results = PARSE_REG_EXP.exec(data);
const floatValue = Number.parseFloat(results?.[1] || data);
const unit = results?.[4]?.toLowerCase();
const floatValue = !unit && NUMBER_REG.test(data) ? Number.parseFloat(data) : Number.parseFloat(results?.[1]);
if (!Number.isFinite(floatValue) || floatValue < 0) {
return null;
}
if (!unit) {
return Math.floor(floatValue);
}
let i = 0;

@@ -91,0 +87,0 @@ let standard;

{
"name": "better-bytes",
"version": "1.2.1",
"version": "1.2.2",
"description": "Better byte base conversion. Supports two base conversions: kilo binary byte (2^10) and kilobyte (10^3).\n更好的字节进制换算。支持 千位二进制字节(2^10) 和 千字节(10^3) 两种进制换算",

@@ -5,0 +5,0 @@ "author": "CaoMeiYouRen",

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