Comparing version 3.1.5 to 3.1.6
@@ -0,0 +0,0 @@ { |
/** | ||
* filesize | ||
* | ||
* @copyright 2015 Jason Mulligan <jason.mulligan@avoidwork.com> | ||
* @copyright 2016 Jason Mulligan <jason.mulligan@avoidwork.com> | ||
* @license BSD-3-Clause | ||
* @version 3.1.5 | ||
* @version 3.1.6 | ||
*/ | ||
@@ -11,4 +11,4 @@ (function (global) { | ||
const si = { | ||
bits: ["b", "kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb", "Yb"], | ||
bytes: ["B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"] | ||
bits: ["b", "Kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb", "Yb"], | ||
bytes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"] | ||
}; | ||
@@ -78,3 +78,3 @@ | ||
result[0] = Number(val.toFixed(e > 0 ? round : 0)); | ||
result[1] = si[bits ? "bits" : "bytes"][e]; | ||
result[1] = base === 10 && e === 1 ? bits ? "kb" : "kB" : si[bits ? "bits" : "bytes"][e]; | ||
@@ -87,4 +87,2 @@ if (!skip && unix) { | ||
result[1] = ""; | ||
} else if (!bits && result[1] === "k") { | ||
result[1] = "K"; | ||
} | ||
@@ -91,0 +89,0 @@ } |
@@ -6,5 +6,5 @@ "use strict"; | ||
* | ||
* @copyright 2015 Jason Mulligan <jason.mulligan@avoidwork.com> | ||
* @copyright 2016 Jason Mulligan <jason.mulligan@avoidwork.com> | ||
* @license BSD-3-Clause | ||
* @version 3.1.5 | ||
* @version 3.1.6 | ||
*/ | ||
@@ -14,4 +14,4 @@ (function (global) { | ||
var si = { | ||
bits: ["b", "kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb", "Yb"], | ||
bytes: ["B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"] | ||
bits: ["b", "Kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb", "Yb"], | ||
bytes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"] | ||
}; | ||
@@ -93,3 +93,3 @@ | ||
result[0] = Number(val.toFixed(e > 0 ? round : 0)); | ||
result[1] = si[bits ? "bits" : "bytes"][e]; | ||
result[1] = base === 10 && e === 1 ? bits ? "kb" : "kB" : si[bits ? "bits" : "bytes"][e]; | ||
@@ -102,4 +102,2 @@ if (!skip && unix) { | ||
result[1] = ""; | ||
} else if (!bits && result[1] === "k") { | ||
result[1] = "K"; | ||
} | ||
@@ -106,0 +104,0 @@ } |
{ | ||
"name": "filesize", | ||
"description": "JavaScript library to generate a human readable String describing the file size", | ||
"version": "3.1.5", | ||
"version": "3.1.6", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12279
8
261