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.3 to 3.5.4

0

bower.json

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

7

lib/filesize.es6.js

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

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

@@ -37,3 +37,3 @@ (function (global) {

val = 0,
e, base, bits, ceil, full, neg, num, output, round, unix, spacer, standard, symbols;
e, base, bits, ceil, full, fullforms, neg, num, output, round, unix, spacer, standard, symbols;

@@ -53,2 +53,3 @@ if (isNaN(arg)) {

full = descriptor.fullform === true;
fullforms = descriptor.fullforms instanceof Array ? descriptor.fullforms : [];
e = descriptor.exponent !== undefined ? descriptor.exponent : -1;

@@ -130,3 +131,3 @@ num = Number(arg);

if (full) {
result[1] = fullform[standard][e] + (bits ? "bit" : "byte") + (result[0] === 1 ? "" : "s");
result[1] = fullforms[e] ? fullforms[e] : fullform[standard][e] + (bits ? "bit" : "byte") + (result[0] === 1 ? "" : "s");
}

@@ -133,0 +134,0 @@

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

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

@@ -46,2 +46,3 @@ (function (global) {

full = void 0,
fullforms = void 0,
neg = void 0,

@@ -69,2 +70,3 @@ num = void 0,

full = descriptor.fullform === true;
fullforms = descriptor.fullforms instanceof Array ? descriptor.fullforms : [];
e = descriptor.exponent !== undefined ? descriptor.exponent : -1;

@@ -146,3 +148,3 @@ num = Number(arg);

if (full) {
result[1] = fullform[standard][e] + (bits ? "bit" : "byte") + (result[0] === 1 ? "" : "s");
result[1] = fullforms[e] ? fullforms[e] : fullform[standard][e] + (bits ? "bit" : "byte") + (result[0] === 1 ? "" : "s");
}

@@ -149,0 +151,0 @@

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

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

@@ -23,2 +23,5 @@ # filesize.js

### fullforms
_*(array)*_ Array of full form overrides, default is `[]`
### output

@@ -61,2 +64,3 @@ _*(string)*_ Output of function (`array`, `exponent`, `object`, or `string`), default is `string`

filesize(265318, {standard: "iec", fullform: true}); // "259.1 kibibytes"
filesize(12, {fullform: true, fullforms: ["байтов"]}); // "12 байтов"
```

@@ -63,0 +67,0 @@

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