UNPKG

@jss-rule-engine/core

Version:

Rule engine for Sitecore JSS

13 lines (10 loc) 464 B
import { RuleData, RuleEngineContext } from "../types/ruleEngine"; export default async function(rule:RuleData, ruleContext: RuleEngineContext) { var operatorId = rule.attributes?.get('operatorid'); var operator = ruleContext.ruleEngine?.operatorDefinitions.get(operatorId); if(!operator) { throw new Error("Operator definition is missing for id " + operatorId); } throw new Error("Condition is not supported"); }