( input: ConnectionValueInput, )
| 1107 | * `values` map, or the canonical per-variable `inputs` map) into a uniform list |
| 1108 | * of named origins. */ |
| 1109 | const normalizeConnectionInputs = ( |
| 1110 | input: ConnectionValueInput, |
| 1111 | ): readonly NormalizedConnectionInput[] => { |
| 1112 | if ("inputs" in input) { |
| 1113 | return Object.entries(input.inputs).map(([variable, origin]) => ({ variable, origin })); |
| 1114 | } |
| 1115 | if ("values" in input) { |
| 1116 | return Object.entries(input.values).map(([variable, value]) => ({ |
| 1117 | variable, |
| 1118 | origin: { value }, |
| 1119 | })); |
| 1120 | } |
| 1121 | if ("from" in input) { |
| 1122 | return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { from: input.from } }]; |
| 1123 | } |
| 1124 | return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { value: input.value } }]; |
| 1125 | }; |
| 1126 | |
| 1127 | /** Decode a connection row's `item_ids` JSON map (`variable → provider item id`). |
| 1128 | * Tolerates the historically-single shape by returning `{}` for anything that |
no outgoing calls
no test coverage detected