nav tabs on admin dashboard
This commit is contained in:
14
node_modules/webpack/lib/SizeFormatHelpers.js
generated
vendored
14
node_modules/webpack/lib/SizeFormatHelpers.js
generated
vendored
@@ -7,12 +7,18 @@
|
||||
const SizeFormatHelpers = exports;
|
||||
|
||||
SizeFormatHelpers.formatSize = size => {
|
||||
if(size <= 0) {
|
||||
if (typeof size !== "number" || Number.isNaN(size) === true) {
|
||||
return "unknown size";
|
||||
}
|
||||
|
||||
if (size <= 0) {
|
||||
return "0 bytes";
|
||||
}
|
||||
|
||||
const abbreviations = ["bytes", "kB", "MB", "GB"];
|
||||
const index = Math.floor(Math.log(size) / Math.log(1000));
|
||||
const abbreviations = ["bytes", "KiB", "MiB", "GiB"];
|
||||
const index = Math.floor(Math.log(size) / Math.log(1024));
|
||||
|
||||
return `${+(size / Math.pow(1000, index)).toPrecision(3)} ${abbreviations[index]}`;
|
||||
return `${+(size / Math.pow(1024, index)).toPrecision(3)} ${
|
||||
abbreviations[index]
|
||||
}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user