loose-ts-check
Version:
Run TS type-check and ignore certain errors in some files
17 lines (16 loc) • 471 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.saveJSONFile = void 0;
const fs_1 = require("fs");
const saveJSONFile = (path, value) => {
try {
(0, fs_1.writeFileSync)(path, `${JSON.stringify(value, null, 2)}\n`);
}
catch (error) {
if (error instanceof Error) {
return error;
}
return new Error('Unknown error while saving JSON');
}
};
exports.saveJSONFile = saveJSONFile;