( input: ConnectionValueInput, )
| 844 | * `values` map, or the canonical per-variable `inputs` map) into a uniform list |
| 845 | * of named origins. */ |
| 846 | const normalizeConnectionInputs = ( |
| 847 | input: ConnectionValueInput, |
| 848 | ): readonly NormalizedConnectionInput[] => { |
| 849 | if ("inputs" in input) { |
| 850 | return Object.entries(input.inputs).map(([variable, origin]) => ({ variable, origin })); |
| 851 | } |
| 852 | if ("values" in input) { |
| 853 | return Object.entries(input.values).map(([variable, value]) => ({ |
| 854 | variable, |
| 855 | origin: { value }, |
| 856 | })); |
| 857 | } |
| 858 | if ("from" in input) { |
| 859 | return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { from: input.from } }]; |
| 860 | } |
| 861 | return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { value: input.value } }]; |
| 862 | }; |
| 863 | |
| 864 | /** Decode a connection row's `item_ids` JSON map (`variable → provider item id`). |
| 865 | * Tolerates the historically-single shape by returning `{}` for anything that |
no outgoing calls
no test coverage detected