RenderCondition optimises a ConditionNode and renders it to a string. Use this instead of calling node.Render() directly whenever the result will be used as an 'if:' condition in generated YAML.
(node ConditionNode)
| 442 | // Use this instead of calling node.Render() directly whenever the result |
| 443 | // will be used as an 'if:' condition in generated YAML. |
| 444 | func RenderCondition(node ConditionNode) string { |
| 445 | return OptimizeExpression(node).Render() |
| 446 | } |
| 447 | |
| 448 | // RenderConditionAsIf renders a ConditionNode as an 'if' condition with proper YAML indentation. |
| 449 | // The condition is automatically optimised with OptimizeExpression before rendering. |