refactor(core): Delete duplicate code across all commands (#5452)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-02-10 14:59:20 +01:00
committed by GitHub
parent 8494c97821
commit 5194513850
26 changed files with 979 additions and 1345 deletions

View File

@@ -1,6 +1,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { CliWorkflowOperationError, SubworkflowOperationError } from 'n8n-workflow';
import type { INode } from 'n8n-workflow';
import { START_NODES } from './constants';
function findWorkflowStart(executionMode: 'integrated' | 'cli') {
return function (nodes: INode[]) {
@@ -10,7 +11,7 @@ function findWorkflowStart(executionMode: 'integrated' | 'cli') {
if (executeWorkflowTriggerNode) return executeWorkflowTriggerNode;
const startNode = nodes.find((node) => node.type === 'n8n-nodes-base.start');
const startNode = nodes.find((node) => START_NODES.includes(node.type));
if (startNode) return startNode;