"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("mz/fs");
const path = require("path");
const dirs = new Set();
async function default_1(fileDest, buffer, mode) {
    await makeDirForFile(fileDest);
    await fs.writeFile(fileDest, buffer, { mode });
}
exports.default = default_1;
async function makeDirForFile(fileDest) {
    const dir = path.dirname(fileDest);
    if (!dirs.has(dir)) {
        await fs.mkdir(dir, { recursive: true });
        dirs.add(dir);
    }
}
//# sourceMappingURL=writeFile.js.map