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