prisma-trpc-generator
Version:
Prisma 2+ generator to emit fully implemented tRPC routers
21 lines • 845 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = removeDir;
const path_1 = __importDefault(require("path"));
const fs_1 = require("fs");
async function removeDir(dirPath, onlyContent) {
const dirEntries = await fs_1.promises.readdir(dirPath, { withFileTypes: true });
await Promise.all(dirEntries.map(async (dirEntry) => {
const fullPath = path_1.default.join(dirPath, dirEntry.name);
return dirEntry.isDirectory()
? await removeDir(fullPath, false)
: await fs_1.promises.unlink(fullPath);
}));
if (!onlyContent) {
await fs_1.promises.rmdir(dirPath);
}
}
//# sourceMappingURL=removeDir.js.map