Socket
Socket
Sign inDemoInstall

filesize

Package Overview
Dependencies
Maintainers
1
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filesize - npm Package Compare versions

Comparing version 3.5.4 to 3.5.5

0

bower.json

@@ -0,0 +0,0 @@ {

33

lib/filesize.es6.js

@@ -6,3 +6,3 @@ /**

* @license BSD-3-Clause
* @version 3.5.4
* @version 3.5.5
*/

@@ -63,22 +63,21 @@ (function (global) {

// Determining the exponent
if (e === -1 || isNaN(e)) {
e = Math.floor(Math.log(num) / Math.log(ceil));
if (e < 0) {
e = 0;
}
}
// Exceeding supported length, time to reduce & multiply
if (e > 8) {
e = 8;
}
// Zero is now a special case because bytes divide by 1
if (num === 0) {
e = 0;
result[0] = 0;
result[1] = unix ? "" : !bits ? "B" : "b";
result[1] = unix ? "" : symbol[standard][bits ? "bits" : "bytes"][e];
} else {
// Determining the exponent
if (e === -1 || isNaN(e)) {
e = Math.floor(Math.log(num) / Math.log(ceil));
if (e < 0) {
e = 0;
}
}
// Exceeding supported length, time to reduce & multiply
if (e > 8) {
e = 8;
}
val = num / (base === 2 ? Math.pow(2, e * 10) : Math.pow(1000, e));

@@ -85,0 +84,0 @@

@@ -8,3 +8,3 @@ "use strict";

* @license BSD-3-Clause
* @version 3.5.4
* @version 3.5.5
*/

@@ -80,22 +80,21 @@ (function (global) {

// Determining the exponent
if (e === -1 || isNaN(e)) {
e = Math.floor(Math.log(num) / Math.log(ceil));
if (e < 0) {
e = 0;
}
}
// Exceeding supported length, time to reduce & multiply
if (e > 8) {
e = 8;
}
// Zero is now a special case because bytes divide by 1
if (num === 0) {
e = 0;
result[0] = 0;
result[1] = unix ? "" : !bits ? "B" : "b";
result[1] = unix ? "" : symbol[standard][bits ? "bits" : "bytes"][e];
} else {
// Determining the exponent
if (e === -1 || isNaN(e)) {
e = Math.floor(Math.log(num) / Math.log(ceil));
if (e < 0) {
e = 0;
}
}
// Exceeding supported length, time to reduce & multiply
if (e > 8) {
e = 8;
}
val = num / (base === 2 ? Math.pow(2, e * 10) : Math.pow(1000, e));

@@ -102,0 +101,0 @@

{
"name": "filesize",
"description": "JavaScript library to generate a human readable String describing the file size",
"version": "3.5.4",
"version": "3.5.5",
"homepage": "http://filesizejs.com",

@@ -6,0 +6,0 @@ "author": "Jason Mulligan <jason.mulligan@avoidwork.com>",

@@ -0,0 +0,0 @@ # filesize.js

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc