Skip to content

Commit b66d8c6

Browse files
authored
Merge pull request #113 from avoidwork/exponents
Adding `exponent` to `object` output, fixes #112
2 parents 6eb9744 + 8acef4c commit b66d8c6

12 files changed

+568
-499
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: node_js
22
node_js:
33
- node
4+
- 12
45
- 10
56
- 8
67

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2019, Jason Mulligan
1+
Copyright (c) 2020, Jason Mulligan
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ filesize(265318, {base: 10}); // "265.32 kB"
5959
filesize(265318); // "259.1 KB"
6060
filesize(265318, {round: 0}); // "259 KB"
6161
filesize(265318, {output: "array"}); // [259.1, "KB"]
62-
filesize(265318, {output: "object"}); // {value: 259.1, symbol: "KB"}
62+
filesize(265318, {output: "object"}); // {value: 259.1, symbol: "KB", exponent: 1}
6363
filesize(1, {symbols: {B: "Б"}}); // "1 Б"
6464
filesize(1024); // "1 KB"
6565
filesize(1024, {exponent: 0}); // "1024 B"

lib/filesize.es6.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* filesize
33
*
4-
* @copyright 2019 Jason Mulligan <[email protected]>
4+
* @copyright 2020 Jason Mulligan <[email protected]>
55
* @license BSD-3-Clause
6-
* @version 6.0.1
6+
* @version 6.1.0
77
*/
88
(function (global) {
99
const b = /^(b|B)$/,
@@ -141,7 +141,7 @@
141141
}
142142

143143
if (output === "object") {
144-
return {value: result[0], symbol: result[1]};
144+
return {value: result[0], symbol: result[1], exponent: e};
145145
}
146146

147147
return result.join(spacer);

lib/filesize.es6.min.js

+5-5
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.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
/**
44
* filesize
55
*
6-
* @copyright 2019 Jason Mulligan <[email protected]>
6+
* @copyright 2020 Jason Mulligan <[email protected]>
77
* @license BSD-3-Clause
8-
* @version 6.0.1
8+
* @version 6.1.0
99
*/
1010
(function (global) {
1111
var b = /^(b|B)$/,
@@ -161,7 +161,8 @@
161161
if (output === "object") {
162162
return {
163163
value: result[0],
164-
symbol: result[1]
164+
symbol: result[1],
165+
exponent: e
165166
};
166167
}
167168

lib/filesize.min.js

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

lib/filesize.min.js.map

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

0 commit comments

Comments
 (0)