Re-lint a load of nodes

This commit is contained in:
Dave Conway-Jones
2017-01-29 17:45:44 +00:00
parent 603189f123
commit 316a2fd272
42 changed files with 447 additions and 254 deletions

View File

@@ -20,14 +20,17 @@ module.exports = function(RED) {
}
if (node.fieldType === 'msg') {
RED.util.setMessageProperty(msg,node.field,value);
} else if (node.fieldType === 'flow') {
}
else if (node.fieldType === 'flow') {
node.context().flow.set(node.field,value);
} else if (node.fieldType === 'global') {
}
else if (node.fieldType === 'global') {
node.context().global.set(node.field,value);
}
node.send(msg);
} catch(err) {
node.error(err.message);
}
catch(e) {
node.error(e.message);
}
});
}

View File

@@ -10,7 +10,8 @@ module.exports = function(RED) {
this.on("input", function(msg) {
if (node.inte == "true" || node.inte === true) {
msg.payload = Math.round(Number(Math.random()) * (node.high - node.low + 1) + node.low - 0.5);
} else {
}
else {
msg.payload = Number(Math.random()) * (node.high - node.low) + node.low;
}
node.send(msg);

View File

@@ -42,7 +42,7 @@ module.exports = function(RED) {
tot = tot + n - pop;
tot2 = tot2 + (n*n) - (pop * pop);
if (a.length > 1) {
msg.payload = Math.sqrt((a.length * tot2 - tot * tot)/(a.length * (a.length - 1)));
msg.payload = Math.sqrt((a.length * tot2 - tot * tot)/(a.length * (a.length - 1)));
}
else { msg.payload = 0; }
}