"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertBytes = void 0;
const fsPromises = require("fs/promises");
const fs = require('fs-extra');
// Delete a directory and its children 
const convertBytes = (bytes) => {
    const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
    if (bytes == 0) {
        return "n/a";
    }
    const i = +(Math.floor(Math.log(bytes) / Math.log(1024)));
    if (i == 0) {
        return bytes + " " + sizes[i];
    }
    // return (bytes / Math.pow(1024, i)).toFixed(1) + " " + sizes[i]
    return (bytes / Math.pow(1024, i)).toFixed(1);
};
exports.convertBytes = convertBytes;
