diff --git a/web/src/utils/zincutils.ts b/web/src/utils/zincutils.ts index b32999d3a3..3647a33c5e 100644 --- a/web/src/utils/zincutils.ts +++ b/web/src/utils/zincutils.ts @@ -579,19 +579,16 @@ export function addSpacesToOperators(input: string): string { let inSingleQuote = false; let inDoubleQuote = false; let parenDepth = 0; - while (i < input.length) { const char = input[i]; const nextChar = input[i + 1]; const prevChar = i > 0 ? input[i - 1] : ''; - // Track quote states if (char === "'" && !inDoubleQuote) { inSingleQuote = !inSingleQuote; } else if (char === '"' && !inSingleQuote) { inDoubleQuote = !inDoubleQuote; } - // Track parentheses depth (for function calls) if (!inSingleQuote && !inDoubleQuote) { if (char === '(') { @@ -622,7 +619,6 @@ export function addSpacesToOperators(input: string): string { continue; } } - // Handle special case of "! =" (space between ! and =) if (char === '!' && nextChar === ' ' && i + 2 < input.length && input[i + 2] === '=') { // Add space before if needed @@ -637,7 +633,6 @@ export function addSpacesToOperators(input: string): string { i += 3; continue; } - // Handle single-character operators if (char === '=' || char === '>' || char === '<') { // Add space before if needed @@ -653,12 +648,10 @@ export function addSpacesToOperators(input: string): string { continue; } } - // Default: just add the character result += char; i++; } - return result; }