tests for defaults in switch, change and range nodes.

This commit is contained in:
dceejay
2015-03-24 17:35:54 +00:00
parent 8748be28b7
commit 72a9de058d
4 changed files with 49 additions and 20 deletions

View File

@@ -35,10 +35,10 @@ module.exports = function(RED) {
function SwitchNode(n) {
RED.nodes.createNode(this, n);
this.rules = n.rules;
this.rules = n.rules || [];
this.property = n.property;
this.checkall = n.checkall || "true";
var propertyParts = n.property.split(".");
var propertyParts = (n.property || "payload").split(".");
var node = this;
for (var i=0; i<this.rules.length; i+=1) {