Skip to content

Commit 9bf357c

Browse files
authored
Merge pull request #128 from avoidwork/fullformbug
Fixing `array` output such that `fullform` is a potential output
2 parents 06d754a + e511614 commit 9bf357c

7 files changed

+16
-16
lines changed

lib/filesize.es6.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,15 @@
137137
result[0] = result[0].toString().replace(".", separator);
138138
}
139139

140+
if (full) {
141+
result[1] = fullforms[e] ? fullforms[e] : fullform[standard][e] + (bits ? "bit" : "byte") + (result[0] === 1 ? "" : "s");
142+
}
143+
140144
// Returning Array, Object, or String (default)
141145
if (output === "array") {
142146
return result;
143147
}
144148

145-
if (full) {
146-
result[1] = fullforms[e] ? fullforms[e] : fullform[standard][e] + (bits ? "bit" : "byte") + (result[0] === 1 ? "" : "s");
147-
}
148-
149149
if (output === "object") {
150150
return {value: result[0], symbol: result[1], exponent: e};
151151
}

lib/filesize.es6.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)