( input: ConnectionValueInput, )
| 982 | * `values` map, or the canonical per-variable `inputs` map) into a uniform list |
| 983 | * of named origins. */ |
| 984 | const normalizeConnectionInputs = ( |
| 985 | input: ConnectionValueInput, |
| 986 | ): readonly NormalizedConnectionInput[] => { |
| 987 | if ("inputs" in input) { |
| 988 | return Object.entries(input.inputs).map(([variable, origin]) => ({ variable, origin })); |
| 989 | } |
| 990 | if ("values" in input) { |
| 991 | return Object.entries(input.values).map(([variable, value]) => ({ |
| 992 | variable, |
| 993 | origin: { value }, |
| 994 | })); |
| 995 | } |
| 996 | if ("from" in input) { |
| 997 | return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { from: input.from } }]; |
| 998 | } |
| 999 | return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { value: input.value } }]; |
| 1000 | }; |
| 1001 | |
| 1002 | /** Decode a connection row's `item_ids` JSON map (`variable → provider item id`). |
| 1003 | * Tolerates the historically-single shape by returning `{}` for anything that |
no outgoing calls
no test coverage detected