feat: refactoring project
This commit is contained in:
6
node_modules/webpack/lib/SizeFormatHelpers.js
generated
vendored
6
node_modules/webpack/lib/SizeFormatHelpers.js
generated
vendored
@@ -9,7 +9,7 @@
|
||||
* @param {number} size the size in bytes
|
||||
* @returns {string} the formatted size
|
||||
*/
|
||||
exports.formatSize = size => {
|
||||
module.exports.formatSize = size => {
|
||||
if (typeof size !== "number" || Number.isNaN(size) === true) {
|
||||
return "unknown size";
|
||||
}
|
||||
@@ -21,7 +21,5 @@ exports.formatSize = size => {
|
||||
const abbreviations = ["bytes", "KiB", "MiB", "GiB"];
|
||||
const index = Math.floor(Math.log(size) / Math.log(1024));
|
||||
|
||||
return `${+(size / Math.pow(1024, index)).toPrecision(3)} ${
|
||||
abbreviations[index]
|
||||
}`;
|
||||
return `${Number((size / 1024 ** index).toPrecision(3))} ${abbreviations[index]}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user