( input: ConnectionValueInput, )
| 583 | * `values` map, or the canonical per-variable `inputs` map) into a uniform list |
| 584 | * of named origins. */ |
| 585 | const normalizeConnectionInputs = ( |
| 586 | input: ConnectionValueInput, |
| 587 | ): readonly NormalizedConnectionInput[] => { |
| 588 | if ("inputs" in input) { |
| 589 | return Object.entries(input.inputs).map(([variable, origin]) => ({ variable, origin })); |
| 590 | } |
| 591 | if ("values" in input) { |
| 592 | return Object.entries(input.values).map(([variable, value]) => ({ |
| 593 | variable, |
| 594 | origin: { value }, |
| 595 | })); |
| 596 | } |
| 597 | if ("from" in input) { |
| 598 | return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { from: input.from } }]; |
| 599 | } |
| 600 | return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { value: input.value } }]; |
| 601 | }; |
| 602 | |
| 603 | /** Decode a connection row's `item_ids` JSON map (`variable → provider item id`). |
| 604 | * Tolerates the historically-single shape by returning `{}` for anything that |
no outgoing calls
no test coverage detected