( input: ConnectionValueInput, )
| 1159 | * `values` map, or the canonical per-variable `inputs` map) into a uniform list |
| 1160 | * of named origins. */ |
| 1161 | const normalizeConnectionInputs = ( |
| 1162 | input: ConnectionValueInput, |
| 1163 | ): readonly NormalizedConnectionInput[] => { |
| 1164 | if ("inputs" in input) { |
| 1165 | return Object.entries(input.inputs).map(([variable, origin]) => ({ |
| 1166 | variable, |
| 1167 | origin, |
| 1168 | })); |
| 1169 | } |
| 1170 | if ("values" in input) { |
| 1171 | return Object.entries(input.values).map(([variable, value]) => ({ |
| 1172 | variable, |
| 1173 | origin: { value }, |
| 1174 | })); |
| 1175 | } |
| 1176 | if ("from" in input) { |
| 1177 | return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { from: input.from } }]; |
| 1178 | } |
| 1179 | return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { value: input.value } }]; |
| 1180 | }; |
| 1181 | |
| 1182 | /** Decode a connection row's `item_ids` JSON map (`variable → provider item id`). |
| 1183 | * Tolerates the historically-single shape by returning `{}` for anything that |
no outgoing calls
no test coverage detected