Commit 064cd702 authored by MARCO Jonathan's avatar MARCO Jonathan
Browse files

馃悰 Fix the condition bug with the end parenthesis

parent 63735d4f
......@@ -96,7 +96,10 @@ const conditionsCheckOneByOne = (
parentArray.push(subConditionArray[0]);
i = subConditionIFinal;
} else {
if ((conditions[i].type === 'item' && conditions[i].value === '(' && i === conditions.length - 1) || i !== conditions.length - 1) {
if (
(conditions[i].type === 'item' && conditions[i].value === '(' && i === conditions.length - 1) ||
(i !== conditions.length - 1 && conditions[i + 1].value !== ')')
) {
throw new Error('Invalid condition');
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment