* Convert a single property value, handling NestedMap, ListLiteral, and ParameterRef.
(value: unknown)
| 592 | * Convert a single property value, handling NestedMap, ListLiteral, and ParameterRef. |
| 593 | */ |
| 594 | function convertNestedPropertyValue(value: unknown): unknown { |
| 595 | if (value === null || value === undefined) { |
| 596 | return value; |
| 597 | } |
| 598 | |
| 599 | if (typeof value !== "object") { |
| 600 | return value; |
| 601 | } |
| 602 | |
| 603 | const obj = value as Record<string, unknown>; |
| 604 | |
| 605 | // Handle NestedMap - convert to plain object recursively |
| 606 | if (obj.type === "NestedMap") { |
| 607 | return convertPropertyMap(obj.value as Record<string, unknown>); |
| 608 | } |
| 609 | |
| 610 | // Handle ListLiteral - convert to plain array recursively |
| 611 | if (obj.type === "ListLiteral") { |
| 612 | return (obj.values as unknown[]).map(convertNestedPropertyValue); |
| 613 | } |
| 614 | |
| 615 | // Handle ParameterRef - preserve as-is for runtime resolution |
| 616 | // The Steps expect the original ParameterRef format |
| 617 | if (obj.type === "ParameterRef") { |
| 618 | return obj; |
| 619 | } |
| 620 | |
| 621 | // For other objects (shouldn't happen in valid AST), return as-is |
| 622 | return value; |
| 623 | } |
| 624 | |
| 625 | /** |
| 626 | * Convert a CREATE clause into a CreateStep. |
no test coverage detected