declapract
Version:
A tool to declaratively define best practices, maintainable evolve them, and scalably enforce them.
15 lines • 556 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.doesDirectoryExist = void 0;
const fs_1 = require("fs");
const doesDirectoryExist = async ({ directory, }) => {
try {
const stat = await fs_1.promises.lstat(`${directory.replace('/$', '')}/`); // make sure there's a `/` at the end, so that symbolic links are dereferenced
return stat.isDirectory();
}
catch (error) {
return false;
}
};
exports.doesDirectoryExist = doesDirectoryExist;
//# sourceMappingURL=doesDirectoryExist.js.map