( input: ConnectionValueInput, )
| 882 | * `values` map, or the canonical per-variable `inputs` map) into a uniform list |
| 883 | * of named origins. */ |
| 884 | const normalizeConnectionInputs = ( |
| 885 | input: ConnectionValueInput, |
| 886 | ): readonly NormalizedConnectionInput[] => { |
| 887 | if ("inputs" in input) { |
| 888 | return Object.entries(input.inputs).map(([variable, origin]) => ({ variable, origin })); |
| 889 | } |
| 890 | if ("values" in input) { |
| 891 | return Object.entries(input.values).map(([variable, value]) => ({ |
| 892 | variable, |
| 893 | origin: { value }, |
| 894 | })); |
| 895 | } |
| 896 | if ("from" in input) { |
| 897 | return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { from: input.from } }]; |
| 898 | } |
| 899 | return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { value: input.value } }]; |
| 900 | }; |
| 901 | |
| 902 | /** Decode a connection row's `item_ids` JSON map (`variable → provider item id`). |
| 903 | * Tolerates the historically-single shape by returning `{}` for anything that |
no outgoing calls
no test coverage detected