-
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating lock file, updating changelog, version bump to release & bui…
…lding outputs
- Loading branch information
Showing
12 changed files
with
412 additions
and
407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* | ||
* @copyright 2021 Jason Mulligan <[email protected]> | ||
* @license BSD-3-Clause | ||
* @version 7.0.0 | ||
* @version 8.0.0 | ||
*/ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
|
@@ -14,11 +14,11 @@ | |
const b = /^(b|B)$/, | ||
symbol = { | ||
iec: { | ||
bits: ["b", "Kib", "Mib", "Gib", "Tib", "Pib", "Eib", "Zib", "Yib"], | ||
bits: ["bit", "Kibit", "Mibit", "Gibit", "Tibit", "Pibit", "Eibit", "Zibit", "Yibit"], | ||
bytes: ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"] | ||
}, | ||
jedec: { | ||
bits: ["b", "Kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb", "Yb"], | ||
bits: ["bit", "Kbit", "Mbit", "Gbit", "Tbit", "Pbit", "Ebit", "Zbit", "Ybit"], | ||
bytes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"] | ||
} | ||
}, | ||
|
@@ -51,14 +51,14 @@ | |
bits = descriptor.bits === true; | ||
unix = descriptor.unix === true; | ||
pad = descriptor.pad === true; | ||
base = descriptor.base || 2; | ||
base = descriptor.base || 10; | ||
round = descriptor.round !== void 0 ? descriptor.round : unix ? 1 : 2; | ||
locale = descriptor.locale !== void 0 ? descriptor.locale : ""; | ||
localeOptions = descriptor.localeOptions || {}; | ||
separator = descriptor.separator !== void 0 ? descriptor.separator : ""; | ||
spacer = descriptor.spacer !== void 0 ? descriptor.spacer : unix ? "" : " "; | ||
symbols = descriptor.symbols || {}; | ||
standard = base === 2 ? descriptor.standard || "jedec" : "jedec"; | ||
standard = base === 2 ? descriptor.standard || "iec" : "jedec"; | ||
output = descriptor.output || "string"; | ||
full = descriptor.fullform === true; | ||
fullforms = descriptor.fullforms instanceof Array ? descriptor.fullforms : []; | ||
|
@@ -120,10 +120,10 @@ | |
e++; | ||
} | ||
|
||
u = result[1] = base === 10 && e === 1 ? bits ? "kb" : "kB" : symbol[standard][bits ? "bits" : "bytes"][e]; | ||
u = result[1] = base === 10 && e === 1 ? bits ? "kbit" : "kB" : symbol[standard][bits ? "bits" : "bytes"][e]; | ||
|
||
if (unix) { | ||
result[1] = standard === "jedec" ? result[1].charAt(0) : e > 0 ? result[1].replace(/B$/, "") : result[1]; | ||
result[1] = result[1].charAt(0); | ||
|
||
if (b.test(result[1])) { | ||
result[0] = Math.floor(result[0]); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,16 +3,16 @@ | |
* | ||
* @copyright 2021 Jason Mulligan <[email protected]> | ||
* @license BSD-3-Clause | ||
* @version 7.0.0 | ||
* @version 8.0.0 | ||
*/ | ||
const b = /^(b|B)$/, | ||
symbol = { | ||
iec: { | ||
bits: ["b", "Kib", "Mib", "Gib", "Tib", "Pib", "Eib", "Zib", "Yib"], | ||
bits: ["bit", "Kibit", "Mibit", "Gibit", "Tibit", "Pibit", "Eibit", "Zibit", "Yibit"], | ||
bytes: ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"] | ||
}, | ||
jedec: { | ||
bits: ["b", "Kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb", "Yb"], | ||
bits: ["bit", "Kbit", "Mbit", "Gbit", "Tbit", "Pbit", "Ebit", "Zbit", "Ybit"], | ||
bytes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"] | ||
} | ||
}, | ||
|
@@ -45,14 +45,14 @@ function filesize (arg, descriptor = {}) { | |
bits = descriptor.bits === true; | ||
unix = descriptor.unix === true; | ||
pad = descriptor.pad === true; | ||
base = descriptor.base || 2; | ||
base = descriptor.base || 10; | ||
round = descriptor.round !== void 0 ? descriptor.round : unix ? 1 : 2; | ||
locale = descriptor.locale !== void 0 ? descriptor.locale : ""; | ||
localeOptions = descriptor.localeOptions || {}; | ||
separator = descriptor.separator !== void 0 ? descriptor.separator : ""; | ||
spacer = descriptor.spacer !== void 0 ? descriptor.spacer : unix ? "" : " "; | ||
symbols = descriptor.symbols || {}; | ||
standard = base === 2 ? descriptor.standard || "jedec" : "jedec"; | ||
standard = base === 2 ? descriptor.standard || "iec" : "jedec"; | ||
output = descriptor.output || "string"; | ||
full = descriptor.fullform === true; | ||
fullforms = descriptor.fullforms instanceof Array ? descriptor.fullforms : []; | ||
|
@@ -114,10 +114,10 @@ function filesize (arg, descriptor = {}) { | |
e++; | ||
} | ||
|
||
u = result[1] = base === 10 && e === 1 ? bits ? "kb" : "kB" : symbol[standard][bits ? "bits" : "bytes"][e]; | ||
u = result[1] = base === 10 && e === 1 ? bits ? "kbit" : "kB" : symbol[standard][bits ? "bits" : "bytes"][e]; | ||
|
||
if (unix) { | ||
result[1] = standard === "jedec" ? result[1].charAt(0) : e > 0 ? result[1].replace(/B$/, "") : result[1]; | ||
result[1] = result[1].charAt(0); | ||
|
||
if (b.test(result[1])) { | ||
result[0] = Math.floor(result[0]); | ||
|
@@ -168,4 +168,4 @@ function filesize (arg, descriptor = {}) { | |
// Partial application for functional programming | ||
filesize.partial = opt => arg => filesize(arg, opt); | ||
|
||
export default filesize; | ||
export { filesize as default }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.