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

Function isPropertyAccessExpression

packages/graph/src/astToSteps.ts:2583–2597  ·  view source on GitHub ↗

* Helper to check if an expression is a property access

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

Source from the content-addressed store, hash-verified

2581 * Helper to check if an expression is a property access
2582 */
2583function isPropertyAccessExpression(
2584 item: import("./AST.js").ReturnItem,
2585): { variable: string; property: string } | null {
2586 if (item.variable && item.property) {
2587 return { variable: item.variable, property: item.property };
2588 }
2589 const expr = item.expression;
2590 if (expr && typeof expr === "object" && "type" in expr) {
2591 if (expr.type === "PropertyAccess") {
2592 const prop = expr as import("./AST.js").PropertyAccess;
2593 return { variable: prop.variable, property: prop.property };
2594 }
2595 }
2596 return null;
2597}
2598
2599/**
2600 * Convert RETURN clause to appropriate steps.

Callers 1

convertReturnClauseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected