first commit
This commit is contained in:
40
node_modules/n8n-workflow/dist/esm/common/map-connections-by-destination.js
generated
vendored
Normal file
40
node_modules/n8n-workflow/dist/esm/common/map-connections-by-destination.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
/* eslint-disable @typescript-eslint/no-for-in-array */
|
||||
export function mapConnectionsByDestination(connections) {
|
||||
const returnConnection = {};
|
||||
let connectionInfo;
|
||||
let maxIndex;
|
||||
for (const sourceNode in connections) {
|
||||
if (!connections.hasOwnProperty(sourceNode)) {
|
||||
continue;
|
||||
}
|
||||
for (const type of Object.keys(connections[sourceNode])) {
|
||||
if (!connections[sourceNode].hasOwnProperty(type)) {
|
||||
continue;
|
||||
}
|
||||
for (const inputIndex in connections[sourceNode][type]) {
|
||||
if (!connections[sourceNode][type].hasOwnProperty(inputIndex)) {
|
||||
continue;
|
||||
}
|
||||
for (connectionInfo of connections[sourceNode][type][inputIndex] ?? []) {
|
||||
if (!returnConnection.hasOwnProperty(connectionInfo.node)) {
|
||||
returnConnection[connectionInfo.node] = {};
|
||||
}
|
||||
if (!returnConnection[connectionInfo.node].hasOwnProperty(connectionInfo.type)) {
|
||||
returnConnection[connectionInfo.node][connectionInfo.type] = [];
|
||||
}
|
||||
maxIndex = returnConnection[connectionInfo.node][connectionInfo.type].length - 1;
|
||||
for (let j = maxIndex; j < connectionInfo.index; j++) {
|
||||
returnConnection[connectionInfo.node][connectionInfo.type].push([]);
|
||||
}
|
||||
returnConnection[connectionInfo.node][connectionInfo.type][connectionInfo.index]?.push({
|
||||
node: sourceNode,
|
||||
type,
|
||||
index: parseInt(inputIndex, 10),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnConnection;
|
||||
}
|
||||
//# sourceMappingURL=map-connections-by-destination.js.map
|
||||
Reference in New Issue
Block a user