1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Refactor saveNodeList

This commit is contained in:
Anna Thomas 2014-11-28 09:17:46 +00:00
parent 57bc83b2a7
commit e28f933f64

View File

@ -65,15 +65,14 @@ var registry = (function() {
function saveNodeList() { function saveNodeList() {
var moduleList = {}; var moduleList = {};
for (var mod in moduleConfigs) { for (var module in moduleConfigs) {
if (moduleConfigs.hasOwnProperty(mod)) { if (moduleConfigs.hasOwnProperty(module)) {
var module = mod;
if (!moduleList[module]) { if (!moduleList[module]) {
moduleList[module] = {}; moduleList[module] = {};
moduleList[module].name = module; moduleList[module].name = module;
moduleList[module].nodes = {}; moduleList[module].nodes = {};
} }
var nodes = moduleConfigs[mod].nodes; var nodes = moduleConfigs[module].nodes;
for(var node in nodes) { for(var node in nodes) {
if (nodes.hasOwnProperty(node)) { if (nodes.hasOwnProperty(node)) {
var config = nodes[node]; var config = nodes[node];