From 62fbf339e4ea5c9a7178a2eae10307540d9634f8 Mon Sep 17 00:00:00 2001 From: Narek Hovhannisyan Date: Wed, 21 Feb 2024 16:02:45 +0400 Subject: [PATCH] fix(lib): check inputs in compute, reuse storage --- src/lib/compute.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/lib/compute.ts b/src/lib/compute.ts index 31e3a9f94..59f72bb44 100644 --- a/src/lib/compute.ts +++ b/src/lib/compute.ts @@ -19,10 +19,12 @@ const mergePluginParams = ( inputs: PluginParams[], defaults: PluginParams[] | undefined ) => - inputs.map(input => ({ - ...input, - ...defaults, - })); + inputs + ? inputs.map(input => ({ + ...input, + ...defaults, + })) + : []; /** * 1. If the node has it's own pipeline, defaults or config then use that, @@ -61,7 +63,8 @@ const computeNode = async (node: Node, params: Params): Promise => { const nodeConfig = config && config[pluginName]; if (metadata.kind === 'execute') { - node.outputs = await execute(storage, nodeConfig); + storage = await execute(storage, nodeConfig); + node.outputs = storage; } if (metadata.kind === 'groupby') {