react-code-dataset / wp-calypso /client /landing /stepper /utils /enhance-flow-with-utils.ts
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
Raw History Blame Contribute Delete
415 Bytes
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;
}