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