fix: isRuleActive
This commit is contained in:
parent
211fcb7740
commit
2b97efe5c6
1 changed files with 5 additions and 2 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue