"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FsExtend = void 0;
const fs = require("node:fs");
// extend file system class to improve methods
class FsExtend {
    static rmDir(path) {
        if (fs.existsSync(path)) {
            fs.readdirSync(path).forEach(function (file, index) {
                const curPath = path + '/' + file;
                if (fs.lstatSync(curPath).isDirectory()) {
                    FsExtend.rmDir(curPath);
                }
                else {
                    // delete file
                    fs.unlinkSync(curPath);
                }
            });
            fs.rmdirSync(path);
        }
    }
}
exports.FsExtend = FsExtend;
