UNPKG

ajv-json-logic

Version:
27 lines (24 loc) 695 B
import jsonLogic from 'json-logic-js'; import jsonLogicSchema from '../schemas/json-logic.json.js'; function getDef() { return { keyword: 'jsonLogic', validate: function (logicRule, data) { try { return !!jsonLogic.apply(logicRule, data); } catch (e) { return false; } }, errors: false, metaSchema: jsonLogicSchema, }; } // For CommonJS compatibility if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { module.exports = getDef; module.exports.default = getDef; } export { getDef as default }; //# sourceMappingURL=jsonLogic.js.map