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

Function convertSetMapValue

packages/graph/src/astToSteps.ts:561–575  ·  view source on GitHub ↗

* Convert a SET map value (property map or parameter reference).

(
  value: Record<string, unknown> | { type: "ParameterRef"; name: string },
)

Source from the content-addressed store, hash-verified

559 * Convert a SET map value (property map or parameter reference).
560 */
561function convertSetMapValue(
562 value: Record<string, unknown> | { type: "ParameterRef"; name: string },
563): Record<string, unknown> | { type: "parameter"; name: string } {
564 // Check if it's a parameter reference
565 if (
566 typeof value === "object" &&
567 value !== null &&
568 "type" in value &&
569 value.type === "ParameterRef"
570 ) {
571 return { type: "parameter", name: (value as { name: string }).name };
572 }
573 // It's a property map - convert any nested maps
574 return convertPropertyMap(value as Record<string, unknown>);
575}
576
577/**
578 * Convert a property map, handling nested maps and parameter references.

Callers 1

convertSetClauseFunction · 0.85

Calls 1

convertPropertyMapFunction · 0.85

Tested by

no test coverage detected