re Bug above
That's been fixed
But still not quite right
var outputPort;
function isValidOutput(outputNumber) {
const AVAILABLE_OUTPUTS = 2;
if (outputNumber > AVAILABLE_OUTPUTS) {
node.error("Cannot send to output outputPort, since only 2 outputs available");
return false;
}
else {
return true;
}
}
outputPort = 1;
if ((msg['payload']) == true) {
outputPort = 2;
}
if(isValidOutput(outputPort)) {
node.send([ null, null ]);
}
I think it should end up issuing something like
node.send([null,msg]);