first commit
This commit is contained in:
53
node_modules/n8n-workflow/dist/cjs/common/map-connections-by-destination.js
generated
vendored
Normal file
53
node_modules/n8n-workflow/dist/cjs/common/map-connections-by-destination.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
/* eslint-disable @typescript-eslint/no-for-in-array */
|
||||
(function (factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
var v = factory(require, exports);
|
||||
if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === "function" && define.amd) {
|
||||
define(["require", "exports"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.mapConnectionsByDestination = mapConnectionsByDestination;
|
||||
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