MCPcopy
hub / github.com/directus/directus / constructFlowTree

Function constructFlowTree

api/src/utils/construct-flow-tree.ts:4–16  ·  view source on GitHub ↗
(flow: FlowRaw)

Source from the content-addressed store, hash-verified

2import { omit } from 'lodash-es';
3
4export function constructFlowTree(flow: FlowRaw): Flow {
5 const rootOperation = flow.operations.find((operation) => operation.id === flow.operation) ?? null;
6
7 const operationTree = constructOperationTree(rootOperation, flow.operations);
8
9 const flowTree: Flow = {
10 ...omit(flow, 'operations'),
11 operation: operationTree,
12 options: flow.options ?? {},
13 };
14
15 return flowTree;
16}
17
18function constructOperationTree(root: OperationRaw | null, operations: OperationRaw[]): Operation | null {
19 if (root === null) {

Callers 1

loadMethod · 0.85

Calls 1

constructOperationTreeFunction · 0.85

Tested by

no test coverage detected