How to use the @node-red/util.util.compareObjects function in @node-red/util

To help you get started, we’ve selected a few @node-red/util examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-red / node-red / packages / node_modules / @node-red / runtime / lib / nodes / flows / util.js View on Github external
if (diffNodes(node,newConfig.allNodes[id]) || newConfig.allNodes[id].credentials) {
                                changed[id] = newConfig.allNodes[id];
                                if (changed[id].type === "subflow") {
                                    changedSubflows[id] = changed[id];
                                }
                                // Mark the container as changed
                                if (newConfig.allNodes[changed[id].z]) {
                                    changed[changed[id].z] = newConfig.allNodes[changed[id].z];
                                    if (changed[changed[id].z].type === "subflow") {
                                        changedSubflows[changed[id].z] = changed[changed[id].z];
                                        delete changed[id];
                                    }
                                }
                            }
                            // This node's wiring has changed
                            if (!redUtil.compareObjects(node.wires,newConfig.allNodes[id].wires)) {
                                wiringChanged[id] = newConfig.allNodes[id];
                                // Mark the container as changed
                                if (newConfig.allNodes[wiringChanged[id].z]) {
                                    changed[wiringChanged[id].z] = newConfig.allNodes[wiringChanged[id].z];
                                    if (changed[wiringChanged[id].z].type === "subflow") {
                                        changedSubflows[wiringChanged[id].z] = changed[wiringChanged[id].z];
                                        delete wiringChanged[id];
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        // Look for added nodes
github node-red / node-red / packages / node_modules / @node-red / runtime / lib / nodes / flows / util.js View on Github external
function diffNodes(oldNode,newNode) {
    if (oldNode == null) {
        return true;
    }
    var oldKeys = Object.keys(oldNode).filter(function(p) { return p != "x" && p != "y" && p != "wires" });
    var newKeys = Object.keys(newNode).filter(function(p) { return p != "x" && p != "y" && p != "wires" });
    if (oldKeys.length != newKeys.length) {
        return true;
    }
    for (var i=0;i