Skip to content

Commit bfc3a9f

Browse files
fix: TypeScript error in QueryNormalizer regex matching
- Fix boolean type inference issue with regex match results - Explicitly check for null to ensure proper boolean return type
1 parent 6002843 commit bfc3a9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/cache/QueryNormalizer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ export class QueryNormalizer {
8888
// Check for table browsing patterns (simple SELECT * with basic conditions)
8989
const isTableBrowsing =
9090
// Simple SELECT * queries
91-
(upperQuery.match(/^SELECT \* FROM/) ||
91+
(upperQuery.match(/^SELECT \* FROM/) !== null ||
9292
// SELECT with specific columns from single table
93-
upperQuery.match(/^SELECT [^()]+FROM [^\s,;()]+$/)) &&
93+
upperQuery.match(/^SELECT [^()]+FROM [^\s,;()]+$/) !== null) &&
9494
// With basic WHERE conditions (no subqueries or complex joins)
95-
(!upperQuery.includes('(') || upperQuery.match(/WHERE [^()]+$/)) &&
95+
(!upperQuery.includes('(') || upperQuery.match(/WHERE [^()]+$/) !== null) &&
9696
// No complex operations
9797
!upperQuery.includes('JOIN') &&
9898
!upperQuery.includes('UNION') &&

0 commit comments

Comments
 (0)