* Create a label condition from either simple labels or a label expression. * Returns null if no label filtering is needed.
(
node: NodePattern | { labels: string[]; labelExpression?: LabelExpression },
)
| 2019 | * Returns null if no label filtering is needed. |
| 2020 | */ |
| 2021 | function createNodeLabelCondition( |
| 2022 | node: NodePattern | { labels: string[]; labelExpression?: LabelExpression }, |
| 2023 | ): StepCondition | null { |
| 2024 | if (node.labelExpression) { |
| 2025 | return convertLabelExpression(node.labelExpression); |
| 2026 | } |
| 2027 | if (node.labels.length > 0) { |
| 2028 | return createLabelCondition(node.labels); |
| 2029 | } |
| 2030 | return null; |
| 2031 | } |
| 2032 | |
| 2033 | /** |
| 2034 | * Convert an AST condition value to Step condition value format. |
no test coverage detected