( input: ConnectionValueInput, )
| 605 | * `values` map, or the canonical per-variable `inputs` map) into a uniform list |
| 606 | * of named origins. */ |
| 607 | const normalizeConnectionInputs = ( |
| 608 | input: ConnectionValueInput, |
| 609 | ): readonly NormalizedConnectionInput[] => { |
| 610 | if ("inputs" in input) { |
| 611 | return Object.entries(input.inputs).map(([variable, origin]) => ({ variable, origin })); |
| 612 | } |
| 613 | if ("values" in input) { |
| 614 | return Object.entries(input.values).map(([variable, value]) => ({ |
| 615 | variable, |
| 616 | origin: { value }, |
| 617 | })); |
| 618 | } |
| 619 | if ("from" in input) { |
| 620 | return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { from: input.from } }]; |
| 621 | } |
| 622 | return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { value: input.value } }]; |
| 623 | }; |
| 624 | |
| 625 | /** Decode a connection row's `item_ids` JSON map (`variable → provider item id`). |
| 626 | * Tolerates the historically-single shape by returning `{}` for anything that |
no outgoing calls
no test coverage detected