fix: isRuleActive

This commit is contained in:
tomasz-io 2025-04-03 14:00:15 -07:00
parent 211fcb7740
commit 2b97efe5c6

View file

@ -6,12 +6,14 @@ const TEMPLATE_VAR_REGEX = /^\$\{\{(\s*.*?\s*)\}\}$/;
const createGlobFunction = (activePaths: string[]) => {
return (pattern: string) => {
return activePaths.some((path) => minimatch(path, pattern));
const result = activePaths.some((path) => minimatch(path, pattern));
debugger;
return result;
};
};
const contains = (str: string, searchStr: string): boolean => {
return str.toLowerCase().includes(searchStr.toLowerCase());
return str.includes(searchStr);
};
const evaluateIf = ({
@ -29,6 +31,7 @@ const evaluateIf = ({
}
try {
debugger;
const evaluate = compileExpression(expression, {
extraFunctions: {
glob: createGlobFunction(activePaths),