MCPcopy Create free account
hub / github.com/Shazbot/WH3-Mod-Manager / mergeTableSelectionInputs

Function mergeTableSelectionInputs

src/nodeGraphExecutor.ts:207–233  ·  view source on GitHub ↗
(
  targetIncomingConnections: SerializedConnection[],
  executionResults: Map<string, NodeExecutionResult>,
  nodeMap: Map<string, SerializedNode>,
)

Source from the content-addressed store, hash-verified

205 return sourceResult.data ?? null;
206};
207const mergeTableSelectionInputs = (
208 targetIncomingConnections: SerializedConnection[],
209 executionResults: Map<string, NodeExecutionResult>,
210 nodeMap: Map<string, SerializedNode>,
211) => {
212 const mergedSourceFiles: any[] = [];
213 const allTables: any[] = [];
214 for (const connection of targetIncomingConnections) {
215 const sourceData = extractConnectionData(connection, executionResults, nodeMap);
216 if (sourceData?.type !== "TableSelection") continue;
217 if (sourceData.tables) {
218 allTables.push(...sourceData.tables);
219 }
220 if (sourceData.sourceFiles) {
221 mergedSourceFiles.push(...sourceData.sourceFiles);
222 }
223 }
224 if (allTables.length === 0) {
225 return null;
226 }
227 return {
228 type: "TableSelection",
229 tables: allTables,
230 sourceFiles: mergedSourceFiles,
231 tableCount: allTables.length,
232 };
233};
234const buildInputDataForTarget = (
235 targetNode: SerializedNode,
236 targetIncomingConnections: SerializedConnection[],

Callers 1

buildInputDataForTargetFunction · 0.85

Calls 1

extractConnectionDataFunction · 0.85

Tested by

no test coverage detected