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

Function isPlainVariableExpression

packages/graph/src/astToSteps.ts:2567–2578  ·  view source on GitHub ↗

* Helper to check if an expression is a plain variable reference

(item: import("./AST.js").ReturnItem)

Source from the content-addressed store, hash-verified

2565 * Helper to check if an expression is a plain variable reference
2566 */
2567function isPlainVariableExpression(item: import("./AST.js").ReturnItem): string | null {
2568 if (item.variable && !item.property && !item.function && !item.aggregate) {
2569 return item.variable;
2570 }
2571 const expr = item.expression;
2572 if (expr && typeof expr === "object" && "type" in expr) {
2573 if (expr.type === "VariableRef") {
2574 return (expr as import("./AST.js").VariableRef).variable;
2575 }
2576 }
2577 return null;
2578}
2579
2580/**
2581 * Helper to check if an expression is a property access

Callers 1

convertReturnClauseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected