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

Function flattenSimpleOrChain

packages/graph/src/grammar.js:18256–18262  ·  view source on GitHub ↗
(expr)

Source from the content-addressed store, hash-verified

18254
18255 // Flatten simple OR chain to array of label names
18256 function flattenSimpleOrChain(expr) {
18257 if (expr.type === 'LabelName') return [expr.name];
18258 if (expr.type === 'LabelOr') {
18259 return [...flattenSimpleOrChain(expr.left), ...flattenSimpleOrChain(expr.right)];
18260 }
18261 return [];
18262 }
18263
18264 peg$result = peg$startRuleFunction();
18265

Callers 1

peg$f125Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected