Files
DumasNodes/js/dumas_workflow_metadata.js

15 lines
578 B
JavaScript

// DUMAS nodes are namespaced copies of upstream nodes. Remove copied
// upstream aux_id metadata because it is invalid for the namespaced node.
function sanitizeDumasMetadata(node) {
if (!node || typeof node.type !== "string" || !node.type.startsWith("Dumas")) return;
const properties = node.properties;
if (!properties || !Object.prototype.hasOwnProperty.call(properties, "aux_id")) return;
delete properties.aux_id;
}
app.registerExtension({
name: "DumasNodes.WorkflowMetadata",
nodeCreated: sanitizeDumasMetadata,
loadedGraphNode: sanitizeDumasMetadata,
});