(state: ICommonObject, updateState: IFlowState[])
| 799 | |
| 800 | /** Merges new key-value pairs into the flow state. */ |
| 801 | export const updateFlowState = (state: ICommonObject, updateState: IFlowState[]): ICommonObject => { |
| 802 | const newFlowState: Record<string, string> = {} |
| 803 | for (const s of updateState) { |
| 804 | newFlowState[s.key] = s.value |
| 805 | } |
| 806 | return { ...state, ...newFlowState } |
| 807 | } |
| 808 | |
| 809 | // ─── Private: converting uploads to base64 image content ───────────────────── |
| 810 |