Skip to content

Commit 744c888

Browse files
authored
Merge pull request #10 from petruki/master
fix: Improved Regex Validation implementation
2 parents 6ff563b + fbe4867 commit 744c888

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/utils/index.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,11 @@ function processREGEX(operation, input, values) {
149149
}
150150
return false;
151151
case OperationsType.NOT_EXIST:
152-
for (var i = 0; i < values.length; i++) {
153-
if (input.match(values[i])) {
154-
return false;
155-
}
156-
}
157-
return true;
152+
return !processREGEX(OperationsType.EXIST, input, values);
158153
case OperationsType.EQUAL:
159154
return input.match(`\\b${values[0]}\\b`) != null;
160155
case OperationsType.NOT_EQUAL:
161-
return input.match(`\\b${values[0]}\\b`) == null;
156+
return !processREGEX(OperationsType.EQUAL, input, values);
162157
}
163158
}
164159

0 commit comments

Comments
 (0)