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