File tree Expand file tree Collapse file tree
packages/workflow-engine/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -260,25 +260,17 @@ export class WorkflowEngine {
260260 }
261261
262262 private normalizeGraph ( graph : WorkflowGraph ) : WorkflowGraph {
263- const removedNodeIds = new Set < string > ( ) ;
264263 const nodes = Array . isArray ( graph . nodes )
265- ? graph . nodes . flatMap ( ( node ) => {
266- const normalizedNode = node . type === 'input' ? { ...node , type : 'approval' } : node ;
267- if ( normalizedNode . type === 'end' ) {
268- removedNodeIds . add ( normalizedNode . id ) ;
269- return [ ] ;
264+ ? graph . nodes . map ( ( node ) => {
265+ if ( node . type === 'input' ) {
266+ return { ...node , type : 'approval' } ;
270267 }
271- return [ normalizedNode ] ;
268+ return node ;
272269 } )
273270 : [ ] ;
274271 return {
275272 nodes,
276- connections : Array . isArray ( graph . connections )
277- ? graph . connections . filter (
278- ( connection ) =>
279- ! removedNodeIds . has ( connection . source ) && ! removedNodeIds . has ( connection . target )
280- )
281- : [ ]
273+ connections : Array . isArray ( graph . connections ) ? graph . connections : [ ]
282274 } ;
283275 }
284276
You can’t perform that action at this time.
0 commit comments