removeExtraParenthesis(Defined in: src/parsing/parsing-utilities.ts:517 Cleans up a given string by removing unnecessary parentheses and replacing specific patterns with placeholders for later restoration. The function processes two types of patterns:strToClean
):string
- Substrings starting with “FC:”.
- Parentheses containing logical operators (“AND” or “OR”).
- Identifies and replaces “FC:” patterns with temporary placeholders.
- Iteratively removes or replaces parentheses based on their content.
- Restores the replaced placeholders back into the string.
Parameters
Parameter | Type | Description |
---|---|---|
strToClean | string | The input string to be cleaned of extra parentheses. |
Returns
string
The cleaned string with unnecessary parentheses removed and original patterns restored.