@jss-rule-engine/core
Version:
Rule engine for Sitecore JSS
11 lines (9 loc) • 484 B
text/typescript
import { RuleEngineContext } from "../types/ruleEngine";
//works both for numbers and strings
export default async function(operatorContext:any, _ruleContext: RuleEngineContext) {
if(typeof(operatorContext.parameter1) != "string" ||
typeof(operatorContext.parameter2) != "string"){
return operatorContext.parameter1 != operatorContext.parameter2;
}
return operatorContext.parameter1?.toLowerCase() != operatorContext.parameter2?.toLowerCase();
}