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

Function extractConnectionData

src/nodeGraphExecutor.ts:185–206  ·  view source on GitHub ↗
(
  connection: SerializedConnection,
  executionResults: Map<string, NodeExecutionResult>,
  nodeMap: Map<string, SerializedNode>,
)

Source from the content-addressed store, hash-verified

183 return node.data.textValue || "";
184};
185const extractConnectionData = (
186 connection: SerializedConnection,
187 executionResults: Map<string, NodeExecutionResult>,
188 nodeMap: Map<string, SerializedNode>,
189) => {
190 const sourceResult = executionResults.get(connection.sourceId);
191 if (!sourceResult) return null;
192 if (connection.sourceHandle === "else" && sourceResult.elseData) {
193 return sourceResult.elseData;
194 }
195 const sourceNode = nodeMap.get(connection.sourceId);
196 if (
197 isMultiOutputNodeType(sourceNode?.type) &&
198 connection.sourceHandle &&
199 sourceResult.data &&
200 typeof sourceResult.data === "object" &&
201 !Array.isArray(sourceResult.data)
202 ) {
203 return (sourceResult.data as Record<string, any>)[connection.sourceHandle] ?? null;
204 }
205 return sourceResult.data ?? null;
206};
207const mergeTableSelectionInputs = (
208 targetIncomingConnections: SerializedConnection[],
209 executionResults: Map<string, NodeExecutionResult>,

Callers 2

buildInputDataForTargetFunction · 0.85

Calls 2

isMultiOutputNodeTypeFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected