"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getUsedSpace = exports.checkDiskSpace = void 0;
const check_disk_space_1 = __importDefault(require("check-disk-space"));
exports.checkDiskSpace = check_disk_space_1.default;
const get_folder_size_1 = __importDefault(require("get-folder-size"));
const fs_1 = require("fs");
const util_1 = require("util");
async function getUsedSpace(path) {
    try {
        await util_1.promisify(fs_1.access)(path);
        return new Promise((resolve, reject) => get_folder_size_1.default(path, (err, size) => {
            if (size) {
                resolve(size);
            }
            else {
                reject(err);
            }
        }));
    }
    catch {
        return 0;
    }
}
exports.getUsedSpace = getUsedSpace;
