Skip to content

Commit 9633cda

Browse files
committed
Updating lock file, updating changelog, version bump to release & building outputs
1 parent b2ec833 commit 9633cda

12 files changed

+412
-407
lines changed

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7-
#### [7.0.0](https://github.com//avoidwork/filesize.js.git/compare/7.0.0...7.0.0)
7+
#### [8.0.0](https://github.com//avoidwork/filesize.js.git/compare/7.0.0...8.0.0)
8+
9+
- Make SI and IEC standards defaults [`#138`](https://github.com//avoidwork/filesize.js.git/pull/138)
10+
- Update symbols for bits to "bit" [`#136`](https://github.com//avoidwork/filesize.js.git/pull/136)
11+
- Make SI and IEC standards defaults [`#137`](https://github.com//avoidwork/filesize.js.git/issues/137)
12+
- Updating CHANGELOG.md [`f89b102`](https://github.com//avoidwork/filesize.js.git/commit/f89b1025ae9eb33025032c58592410c49488cb77)
813

914
### [7.0.0](https://github.com//avoidwork/filesize.js.git/compare/6.4.0...7.0.0)
1015

lib/filesize.es6.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* @copyright 2021 Jason Mulligan <[email protected]>
55
* @license BSD-3-Clause
6-
* @version 7.0.0
6+
* @version 8.0.0
77
*/
88
(function (global, factory) {
99
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -14,11 +14,11 @@
1414
const b = /^(b|B)$/,
1515
symbol = {
1616
iec: {
17-
bits: ["b", "Kib", "Mib", "Gib", "Tib", "Pib", "Eib", "Zib", "Yib"],
17+
bits: ["bit", "Kibit", "Mibit", "Gibit", "Tibit", "Pibit", "Eibit", "Zibit", "Yibit"],
1818
bytes: ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"]
1919
},
2020
jedec: {
21-
bits: ["b", "Kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb", "Yb"],
21+
bits: ["bit", "Kbit", "Mbit", "Gbit", "Tbit", "Pbit", "Ebit", "Zbit", "Ybit"],
2222
bytes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
2323
}
2424
},
@@ -51,14 +51,14 @@
5151
bits = descriptor.bits === true;
5252
unix = descriptor.unix === true;
5353
pad = descriptor.pad === true;
54-
base = descriptor.base || 2;
54+
base = descriptor.base || 10;
5555
round = descriptor.round !== void 0 ? descriptor.round : unix ? 1 : 2;
5656
locale = descriptor.locale !== void 0 ? descriptor.locale : "";
5757
localeOptions = descriptor.localeOptions || {};
5858
separator = descriptor.separator !== void 0 ? descriptor.separator : "";
5959
spacer = descriptor.spacer !== void 0 ? descriptor.spacer : unix ? "" : " ";
6060
symbols = descriptor.symbols || {};
61-
standard = base === 2 ? descriptor.standard || "jedec" : "jedec";
61+
standard = base === 2 ? descriptor.standard || "iec" : "jedec";
6262
output = descriptor.output || "string";
6363
full = descriptor.fullform === true;
6464
fullforms = descriptor.fullforms instanceof Array ? descriptor.fullforms : [];
@@ -120,10 +120,10 @@
120120
e++;
121121
}
122122

123-
u = result[1] = base === 10 && e === 1 ? bits ? "kb" : "kB" : symbol[standard][bits ? "bits" : "bytes"][e];
123+
u = result[1] = base === 10 && e === 1 ? bits ? "kbit" : "kB" : symbol[standard][bits ? "bits" : "bytes"][e];
124124

125125
if (unix) {
126-
result[1] = standard === "jedec" ? result[1].charAt(0) : e > 0 ? result[1].replace(/B$/, "") : result[1];
126+
result[1] = result[1].charAt(0);
127127

128128
if (b.test(result[1])) {
129129
result[0] = Math.floor(result[0]);

lib/filesize.es6.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/filesize.es6.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/filesize.esm.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
*
44
* @copyright 2021 Jason Mulligan <[email protected]>
55
* @license BSD-3-Clause
6-
* @version 7.0.0
6+
* @version 8.0.0
77
*/
88
const b = /^(b|B)$/,
99
symbol = {
1010
iec: {
11-
bits: ["b", "Kib", "Mib", "Gib", "Tib", "Pib", "Eib", "Zib", "Yib"],
11+
bits: ["bit", "Kibit", "Mibit", "Gibit", "Tibit", "Pibit", "Eibit", "Zibit", "Yibit"],
1212
bytes: ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"]
1313
},
1414
jedec: {
15-
bits: ["b", "Kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb", "Yb"],
15+
bits: ["bit", "Kbit", "Mbit", "Gbit", "Tbit", "Pbit", "Ebit", "Zbit", "Ybit"],
1616
bytes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
1717
}
1818
},
@@ -45,14 +45,14 @@ function filesize (arg, descriptor = {}) {
4545
bits = descriptor.bits === true;
4646
unix = descriptor.unix === true;
4747
pad = descriptor.pad === true;
48-
base = descriptor.base || 2;
48+
base = descriptor.base || 10;
4949
round = descriptor.round !== void 0 ? descriptor.round : unix ? 1 : 2;
5050
locale = descriptor.locale !== void 0 ? descriptor.locale : "";
5151
localeOptions = descriptor.localeOptions || {};
5252
separator = descriptor.separator !== void 0 ? descriptor.separator : "";
5353
spacer = descriptor.spacer !== void 0 ? descriptor.spacer : unix ? "" : " ";
5454
symbols = descriptor.symbols || {};
55-
standard = base === 2 ? descriptor.standard || "jedec" : "jedec";
55+
standard = base === 2 ? descriptor.standard || "iec" : "jedec";
5656
output = descriptor.output || "string";
5757
full = descriptor.fullform === true;
5858
fullforms = descriptor.fullforms instanceof Array ? descriptor.fullforms : [];
@@ -114,10 +114,10 @@ function filesize (arg, descriptor = {}) {
114114
e++;
115115
}
116116

117-
u = result[1] = base === 10 && e === 1 ? bits ? "kb" : "kB" : symbol[standard][bits ? "bits" : "bytes"][e];
117+
u = result[1] = base === 10 && e === 1 ? bits ? "kbit" : "kB" : symbol[standard][bits ? "bits" : "bytes"][e];
118118

119119
if (unix) {
120-
result[1] = standard === "jedec" ? result[1].charAt(0) : e > 0 ? result[1].replace(/B$/, "") : result[1];
120+
result[1] = result[1].charAt(0);
121121

122122
if (b.test(result[1])) {
123123
result[0] = Math.floor(result[0]);
@@ -168,4 +168,4 @@ function filesize (arg, descriptor = {}) {
168168
// Partial application for functional programming
169169
filesize.partial = opt => arg => filesize(arg, opt);
170170

171-
export default filesize;
171+
export { filesize as default };

lib/filesize.esm.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)