infinity-forge
Version:
27 lines • 679 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseJSON = parseJSON;
exports.stringfyJSON = stringfyJSON;
var ui_1 = require("../../../ui/index.js");
function parseJSON(value) {
try {
if (typeof value === 'string') {
return JSON.parse(value);
}
else {
return null;
}
}
catch (_a) {
return null;
}
}
function stringfyJSON(value) {
try {
return JSON.stringify(value);
}
catch (_a) {
throw new ui_1.BadRequestError({ code: "400", message: "Não foi possível fazer o processamento do json" });
}
}
//# sourceMappingURL=index.js.map