Extra tests for html, xml, json and tail nodes

(and some consistent passing of missing payloads)
This commit is contained in:
dceejay
2015-03-24 17:43:47 +00:00
parent 72a9de058d
commit fcc6943f98
8 changed files with 140 additions and 60 deletions

View File

@@ -31,15 +31,15 @@ module.exports = function(RED) {
catch(e) { node.error(e.message,msg); }
}
else if (typeof msg.payload === "object") {
if (!Buffer.isBuffer(msg.payload) ) {
if (!util.isArray(msg.payload)) {
msg.payload = JSON.stringify(msg.payload);
node.send(msg);
}
if ((!Buffer.isBuffer(msg.payload)) && (!util.isArray(msg.payload))) {
msg.payload = JSON.stringify(msg.payload);
node.send(msg);
}
else { node.warn("Dropped: "+msg.payload); }
}
else { node.warn("dropped: "+msg.payload); }
else { node.warn("Dropped: "+msg.payload); }
}
else { node.send(msg); } // If no payload - just pass it on.
});
}
RED.nodes.registerType("json",JSONNode);