File size: 415 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import type { FlowV2 } from '../declarative-flow/internals/types';

/**
 * Add utility functions to the flow object. This frees the API consumers from making these functions themselves.
 * @param flow the flow.
 * @returns the enhanced flow.
 */
export function enhanceFlowWithUtilityFunctions< T extends FlowV2< any > >( flow: T ): T {
	flow.getSteps = () => {
		return flow.__flowSteps ?? [];
	};
	return flow;
}