UNPKG

@jss-rule-engine/core

Version:

Rule engine for Sitecore JSS

10 lines (8 loc) 410 B
import { RuleEngineContext, RuleOperatorContext } from "../types/ruleEngine"; export default async function(operatorContext:RuleOperatorContext, _ruleContext?: RuleEngineContext) { if(typeof(operatorContext.parameter1) != "string" || typeof(operatorContext.parameter2) != "string"){ return false; } return operatorContext.parameter1.endsWith(operatorContext.parameter2); }