@tokens-studio/graph-engine-migration
Version:
A package to upgrade old graph engine files to the new format
19 lines • 707 B
JavaScript
export const removeRedundantInputValues = async (graph) => {
if (graph.nodes) {
graph.nodes.forEach((node) => {
if (!node || !node.inputs) {
return;
}
node.inputs.forEach(serializedInput => {
const isVariadic = serializedInput.variadic === true;
const isConnected = graph.edges?.some(edge => edge.target === node.id &&
edge.targetHandle === serializedInput.name);
if (isConnected && !isVariadic) {
delete serializedInput.value;
}
});
});
}
return graph;
};
//# sourceMappingURL=removeRedundantInputValues.js.map