@flowfuse/node-red-dashboard-2-migration
Advanced tools
Comparing version 0.0.2 to 0.0.3
28
index.js
@@ -48,22 +48,10 @@ const generators = require('./generators') | ||
console.log(idMap) | ||
// loop ovr all nodes in thw flow and ensure we have updated references: | ||
migratedFlow.forEach(node => { | ||
if (node.wires && node.wires.length) { | ||
node.wires = node.wires.map(wire => { | ||
return wire.map(id => { | ||
return idMap[id] || id | ||
}) | ||
}) | ||
} | ||
if (node.group) { | ||
node.group = idMap[node.group] || node.group | ||
} | ||
if (node.page) { | ||
node.page = idMap[node.page] || node.page | ||
} | ||
}) | ||
return migratedFlow | ||
// work smart, not hard | ||
let strJson = JSON.stringify(migratedFlow) | ||
// loop over idMap | ||
for (const key in idMap) { | ||
// replace all instances of the old ID with the new ID | ||
strJson = strJson.replaceAll(key, idMap[key]) | ||
} | ||
return JSON.parse(strJson) | ||
} | ||
@@ -70,0 +58,0 @@ } |
{ | ||
"name": "@flowfuse/node-red-dashboard-2-migration", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "A module that exposes a migration script for converting Dashboard 1.0 flows to Dashboard 2.0", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
49540
1166