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

Function convertSetOperationToStep

packages/graph/src/astToSteps.ts:1155–1163  ·  view source on GitHub ↗

* Convert a SetOperation (from FOREACH) into a SetStep. * Note: FOREACH SET operations currently only support individual property assignments, * not bulk property operations (n = {props} or n += {props}).

(setOp: ASTSetOperation)

Source from the content-addressed store, hash-verified

1153 * not bulk property operations (n = {props} or n += {props}).
1154 */
1155function convertSetOperationToStep(setOp: ASTSetOperation): SetStep {
1156 const assignments = setOp.assignments.map((assignment) => ({
1157 variable: assignment.variable,
1158 property: assignment.property,
1159 value: convertSetValue(assignment.value),
1160 }));
1161
1162 return new SetStep({ assignments });
1163}
1164
1165/**
1166 * Convert a ShortestPathPattern into a sequence of steps.

Callers 1

convertForeachClauseFunction · 0.85

Calls 2

convertSetValueFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected