From 4f6dc3d6112b721041115fc0ca2f824da1ba535b Mon Sep 17 00:00:00 2001 From: Narek Hovhannisyan Date: Wed, 7 Aug 2024 10:28:00 +0400 Subject: [PATCH] feat(lib): add empty pipeline message --- src/if-run/lib/compute.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/if-run/lib/compute.ts b/src/if-run/lib/compute.ts index 41a153448..27426bbc6 100644 --- a/src/if-run/lib/compute.ts +++ b/src/if-run/lib/compute.ts @@ -5,13 +5,14 @@ import {addExplainData} from './explain'; import {mergeObjects} from '../util/helpers'; import {debugLogger} from '../../common/util/debug-logger'; +import {logger} from '../../common/util/logger'; import {STRINGS} from '../config/strings'; import {ComputeParams, Node, PhasedPipeline} from '../types/compute'; import {isExecute} from '../types/interface'; -const {MERGING_DEFAULTS_WITH_INPUT_DATA} = STRINGS; +const {MERGING_DEFAULTS_WITH_INPUT_DATA, EMPTY_PIPELINE} = STRINGS; /** * Traverses all child nodes based on children grouping. @@ -77,6 +78,10 @@ const computeNode = async (node: Node, params: ComputeParams): Promise => { inputStorage = mergeDefaults(inputStorage, defaults); const pipelineCopy = structuredClone(pipeline) || {}; + if (Object.keys(pipelineCopy).length === 0) { + logger.warn(EMPTY_PIPELINE); + } + /** * If iteration is on observe pipeline, then executes observe plugins and sets the inputs value. */