Union Config
Conditional matching and fallback pipelines with union configurations.
Overview
A Union Configuration defines an ordered list of candidate sub-configurations under union:. The parser evaluates them from top to bottom and returns the result of the first candidate that matches.
Matching the First Valid Selector
union:
- selector: a # will not match
- selector: span # will not match
- selector: p # will matchProviding a Default Fallback Case
By placing a constant: configuration as the final entry in a union list, you can define a guaranteed default value when none of the selector branches match:
union:
- selector: a # will not match
- selector: span # will not match
- constant: default value # will matchNo Matches
If no union branch matches and there is no constant fallback, the output evaluates to null:
union:
- selector: a # will not match
- selector: span # will not match