mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge pull request #4525 from node-red/fix-change-node-boolean-response
Fix change node to return boolean if asked
This commit is contained in:
commit
f66b48e586
@ -233,7 +233,9 @@ module.exports = function(RED) {
|
|||||||
// only replace if they match exactly
|
// only replace if they match exactly
|
||||||
RED.util.setMessageProperty(msg,property,value);
|
RED.util.setMessageProperty(msg,property,value);
|
||||||
} else {
|
} else {
|
||||||
current = current.replace(fromRE,value);
|
// if target is boolean then just replace it
|
||||||
|
if (rule.tot === "bool") { current = value; }
|
||||||
|
else { current = current.replace(fromRE,value); }
|
||||||
RED.util.setMessageProperty(msg,property,current);
|
RED.util.setMessageProperty(msg,property,current);
|
||||||
}
|
}
|
||||||
} else if ((typeof current === 'number' || current instanceof Number) && fromType === 'num') {
|
} else if ((typeof current === 'number' || current instanceof Number) && fromType === 'num') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user