stripExpressionWrapper removes the ${{ }} wrapper from an expression if present
(expression string)
| 14 | |
| 15 | // stripExpressionWrapper removes the ${{ }} wrapper from an expression if present |
| 16 | func stripExpressionWrapper(expression string) string { |
| 17 | // Trim whitespace |
| 18 | expr := strings.TrimSpace(expression) |
| 19 | // Check if it starts with ${{ and ends with }} |
| 20 | if strings.HasPrefix(expr, "${{") && strings.HasSuffix(expr, "}}") { |
| 21 | // Remove the wrapper and trim inner whitespace |
| 22 | return strings.TrimSpace(expr[3 : len(expr)-2]) |
| 23 | } |
| 24 | return expr |
| 25 | } |
| 26 | |
| 27 | // ExpressionParser handles parsing of expression strings into ConditionNode trees |
| 28 | type ExpressionParser struct { |
no outgoing calls
no test coverage detected