chore(FEEDBACK-0001): linting
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
export function preprocessQuery(raw: string): string {
|
||||
// 1. Trim and collapse whitespace.
|
||||
let q = raw.trim().replace(/\s+/g, ' ');
|
||||
const q = raw.trim().replace(/\s+/g, ' ');
|
||||
|
||||
if (!q) return q;
|
||||
|
||||
@@ -73,7 +73,7 @@ export function preprocessQuery(raw: string): string {
|
||||
|
||||
// 3. Separate operators from searchable terms.
|
||||
const searchableTerms = processedTokens.filter((t) => !['AND', 'OR', 'NOT'].includes(t));
|
||||
|
||||
|
||||
if (searchableTerms.length === 0) return '';
|
||||
|
||||
// 4. Reconstruct final tokens keeping operators between searchable terms.
|
||||
@@ -91,7 +91,10 @@ export function preprocessQuery(raw: string): string {
|
||||
}
|
||||
|
||||
// Remove trailing operators
|
||||
while (finalTokens.length > 0 && ['AND', 'OR', 'NOT'].includes(finalTokens[finalTokens.length - 1])) {
|
||||
while (
|
||||
finalTokens.length > 0 &&
|
||||
['AND', 'OR', 'NOT'].includes(finalTokens[finalTokens.length - 1])
|
||||
) {
|
||||
finalTokens.pop();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user