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

Ignore whitespace when checking function setup/close code

This commit is contained in:
Nick O'Leary 2020-06-05 10:36:49 +01:00
parent 7c2786969a
commit 20daebd965
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 6 additions and 4 deletions

View File

@ -222,8 +222,10 @@
}
}
var val = editor.getValue();
if (defaultValue && val == defaultValue) {
val = "";
if (defaultValue) {
if (val.trim() == defaultValue.trim()) {
val = "";
}
}
editor.destroy();
delete node[editorName];

View File

@ -92,8 +92,8 @@ module.exports = function(RED) {
var node = this;
node.name = n.name;
node.func = n.func;
node.ini = n.initialize ? n.initialize : "";
node.fin = n.finalize ? n.finalize : "";
node.ini = n.initialize ? n.initialize.trim() : "";
node.fin = n.finalize ? n.finalize.trim() : "";
var handleNodeDoneCall = true;