sortier
Version:
An opinionated code sorter
30 lines (29 loc) • 872 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FileUtils = void 0;
const tslib_1 = require("tslib");
const fs = tslib_1.__importStar(require("fs"));
const path_1 = require("path");
class FileUtils {
static globbyJoin(...paths) {
const path = (0, path_1.join)(...paths);
return path.split("\\").join("/");
}
static readFileContents(filename) {
try {
return fs.readFileSync(filename, "utf8");
}
catch (error) {
throw new Error(`Could not read file: ${filename}`);
}
}
static writeFileContents(filename, fileContents) {
try {
fs.writeFileSync(filename, fileContents, "utf8");
}
catch (error) {
throw new Error(`Could not write file: ${filename}`);
}
}
}
exports.FileUtils = FileUtils;