Skip to content

Commit 1dee34f

Browse files
committed
Correcting longform to fullform
Version bump Updating README
1 parent 7d8b650 commit 1dee34f

9 files changed

+29
-29
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ _*(boolean)*_ Enables `bit` sizes, default is `false`
1717
### exponent
1818
_*(number)*_ Specifies the SI suffix via exponent, e.g. `2` is `MB` for bytes, default is `-1`
1919

20-
### longform
20+
### fullform
2121
_*(boolean)*_ Enables long form of unit of measure, default is `false`
2222

2323
### output
@@ -56,7 +56,7 @@ filesize(1024); // "1 KB"
5656
filesize(1024, {exponent: 0}); // "1024 B"
5757
filesize(1024, {output: "exponent"}); // 1
5858
filesize(265318, {standard: "iec"}); // "259.1 KiB"
59-
filesize(265318, {standard: "iec", longform: true}); // "259.1 kibibytes"
59+
filesize(265318, {standard: "iec", fullform: true}); // "259.1 kibibytes"
6060
```
6161

6262
## Partial Application

lib/filesize.es6.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* @copyright 2017 Jason Mulligan <[email protected]>
55
* @license BSD-3-Clause
6-
* @version 3.5.0
6+
* @version 3.5.1
77
*/
88
(function (global) {
99
const b = /^(b|B)$/,
@@ -17,7 +17,7 @@
1717
bytes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
1818
}
1919
},
20-
longform = {
20+
fullform = {
2121
iec: ["", "kibi", "mebi", "gibi", "tebi", "pebi", "exbi", "zebi", "yobi"],
2222
jedec: ["", "kilo", "mega", "giga", "tera", "peta", "exa", "zetta", "yotta"]
2323
};
@@ -33,7 +33,7 @@
3333
function filesize (arg, descriptor = {}) {
3434
let result = [],
3535
val = 0,
36-
e, base, bits, ceil, long, neg, num, output, round, unix, spacer, standard, symbols;
36+
e, base, bits, ceil, full, neg, num, output, round, unix, spacer, standard, symbols;
3737

3838
if (isNaN(arg)) {
3939
throw new Error("Invalid arguments");
@@ -47,7 +47,7 @@
4747
symbols = descriptor.symbols || descriptor.suffixes || {};
4848
standard = base === 2 ? descriptor.standard || "jedec" : "jedec";
4949
output = descriptor.output || "string";
50-
long = descriptor.longform === true;
50+
full = descriptor.fullform === true;
5151
e = descriptor.exponent !== undefined ? descriptor.exponent : -1;
5252
num = Number(arg);
5353
neg = num < 0;
@@ -122,8 +122,8 @@
122122
return {value: result[0], suffix: result[1], symbol: result[1]};
123123
}
124124

125-
if (long) {
126-
result[1] = longform[standard][e] + (bits ? "bit" : "byte") + (result[0] > 1 ? "s" : "");
125+
if (full) {
126+
result[1] = fullform[standard][e] + (bits ? "bit" : "byte") + (result[0] > 1 ? "s" : "");
127127
}
128128

129129
return result.join(spacer);

lib/filesize.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @copyright 2017 Jason Mulligan <[email protected]>
77
* @license BSD-3-Clause
8-
* @version 3.5.0
8+
* @version 3.5.1
99
*/
1010
(function (global) {
1111
var b = /^(b|B)$/,
@@ -19,7 +19,7 @@
1919
bytes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
2020
}
2121
},
22-
longform = {
22+
fullform = {
2323
iec: ["", "kibi", "mebi", "gibi", "tebi", "pebi", "exbi", "zebi", "yobi"],
2424
jedec: ["", "kilo", "mega", "giga", "tera", "peta", "exa", "zetta", "yotta"]
2525
};
@@ -41,7 +41,7 @@
4141
base = void 0,
4242
bits = void 0,
4343
ceil = void 0,
44-
long = void 0,
44+
full = void 0,
4545
neg = void 0,
4646
num = void 0,
4747
output = void 0,
@@ -63,7 +63,7 @@
6363
symbols = descriptor.symbols || descriptor.suffixes || {};
6464
standard = base === 2 ? descriptor.standard || "jedec" : "jedec";
6565
output = descriptor.output || "string";
66-
long = descriptor.longform === true;
66+
full = descriptor.fullform === true;
6767
e = descriptor.exponent !== undefined ? descriptor.exponent : -1;
6868
num = Number(arg);
6969
neg = num < 0;
@@ -138,8 +138,8 @@
138138
return { value: result[0], suffix: result[1], symbol: result[1] };
139139
}
140140

141-
if (long) {
142-
result[1] = longform[standard][e] + (bits ? "bit" : "byte") + (result[0] > 1 ? "s" : "");
141+
if (full) {
142+
result[1] = fullform[standard][e] + (bits ? "bit" : "byte") + (result[0] > 1 ? "s" : "");
143143
}
144144

145145
return result.join(spacer);

lib/filesize.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)