MCPcopy Create free account
hub / github.com/codemix/graph / createNodeLabelCondition

Function createNodeLabelCondition

packages/graph/src/astToSteps.ts:2021–2031  ·  view source on GitHub ↗

* 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 },
)

Source from the content-addressed store, hash-verified

2019 * Returns null if no label filtering is needed.
2020 */
2021function 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.

Callers 1

convertPatternFunction · 0.85

Calls 2

convertLabelExpressionFunction · 0.85
createLabelConditionFunction · 0.85

Tested by

no test coverage detected