Skip to content

Commit c856d4c

Browse files
committed
changes done
1 parent 22c9587 commit c856d4c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/lib/query.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,16 @@ export class Query extends BaseQuery {
2525
}
2626
// Validate if input is a valid regex pattern
2727
private isValidRegexPattern(input: string): boolean {
28-
RegExp(input);
29-
return true;
28+
try {
29+
RegExp(input)
30+
return true;
3031
}
31-
32+
catch {
33+
return false;
34+
}
35+
36+
}
37+
3238
// Validate if value is an array of strings, numbers, or booleans
3339
private isValidValue(value: any[]): boolean {
3440
return Array.isArray(value) && value.every(item => typeof item === 'string' || typeof item === 'number' || typeof item === 'boolean');

0 commit comments

Comments
 (0)