( input: ConnectionValueInput, )
| 830 | * `values` map, or the canonical per-variable `inputs` map) into a uniform list |
| 831 | * of named origins. */ |
| 832 | const normalizeConnectionInputs = ( |
| 833 | input: ConnectionValueInput, |
| 834 | ): readonly NormalizedConnectionInput[] => { |
| 835 | if ("inputs" in input) { |
| 836 | return Object.entries(input.inputs).map(([variable, origin]) => ({ variable, origin })); |
| 837 | } |
| 838 | if ("values" in input) { |
| 839 | return Object.entries(input.values).map(([variable, value]) => ({ |
| 840 | variable, |
| 841 | origin: { value }, |
| 842 | })); |
| 843 | } |
| 844 | if ("from" in input) { |
| 845 | return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { from: input.from } }]; |
| 846 | } |
| 847 | return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { value: input.value } }]; |
| 848 | }; |
| 849 | |
| 850 | /** Decode a connection row's `item_ids` JSON map (`variable → provider item id`). |
| 851 | * Tolerates the historically-single shape by returning `{}` for anything that |
no outgoing calls
no test coverage detected