Utilities Functions Reorganized

This commit is contained in:
Luis Fernando Molina committed 2020-05-23 10:45:03 +02:00
1 parent 4a03b7e0c4
commit 2f1536b3a4
7 files changed
+240 -242

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
function savePropertyAtNodeConfig (payload, propertyName, value) {
try {
let code = JSON.parse(payload.node.code)
code[propertyName] = value
payload.node.code = JSON.stringify(code, null, 4)
} catch (err) {
// we ignore errors here since most likely they will be parsing errors.
}
}
function loadPropertyFromNodeConfig (payload, propertyName) {
try {
let code = JSON.parse(payload.node.code)
return code[propertyName]
} catch (err) {
// we ignore errors here since most likely they will be parsing errors.
}
}