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