diff --git a/hardware/blinkstick/76-blinkstick.js b/hardware/blinkstick/76-blinkstick.js index bb78719c..0c1859f1 100644 --- a/hardware/blinkstick/76-blinkstick.js +++ b/hardware/blinkstick/76-blinkstick.js @@ -3,7 +3,7 @@ module.exports = function(RED) { "use strict"; var blinkstick = require("blinkstick"); - var availableModes = ["normal", "inverted", "neopixel"]; + //var availableModes = ["normal", "inverted", "neopixel"]; var availableTasks = ["set_color", "blink", "pulse", "morph"]; Object.size = function(obj) { diff --git a/io/emoncms/88-emoncms.js b/io/emoncms/88-emoncms.js index e8e14b5f..bb3a24f4 100644 --- a/io/emoncms/88-emoncms.js +++ b/io/emoncms/88-emoncms.js @@ -65,8 +65,8 @@ module.exports = function(RED) { // setup the node group for URI. Must have a node group or exit var nodegroup = this.nodegroup || msg.nodegroup; if (typeof nodegroup === "undefined") { - node.error("ERROR: A Node group must be specified - " + nodegroup); - node.status({fill:"red",shape:"ring",text:"No Nodegroup"}); + node.error("ERROR: the nodegroup is undefined"); + node.status({fill:"red",shape:"ring",text:"No nodegroup"}); return; } else { this.url += '&node=' + nodegroup; diff --git a/io/mdns/mdns.js b/io/mdns/mdns.js index 7482ebf3..b9e20f7d 100644 --- a/io/mdns/mdns.js +++ b/io/mdns/mdns.js @@ -58,7 +58,7 @@ module.exports = function(RED) { this.port = n.port; this.name = n.name; this.txt = n.txt; - if (this?.txt && (this.txt !== '')) { + if (typeof this.txt === "string" && this.txt !== '') { try { this.txt = JSON.parse('{'+this.txt+'}'); } catch (e) { delete this.txt; } } diff --git a/io/stomp/18-stomp.js b/io/stomp/18-stomp.js index 30ec6de1..063010f4 100644 --- a/io/stomp/18-stomp.js +++ b/io/stomp/18-stomp.js @@ -430,16 +430,15 @@ module.exports = function(RED) { node.on("input", function(msg, send, done) { const topic = node.topic || msg.topic; - if (topic.length > 0 && msg.payload) { + if (typeof topic === "string" && topic.length > 0 && msg.payload) { try { msg.payload = JSON.stringify(msg.payload); } catch { msg.payload = `${msg.payload}`; } node.serverConnection.publish(topic, msg.payload, msg.headers || {}); - } else if (!topic.length > 0) { + } else if (typeof topic === "string" && topic.length == 0) { node.warn('No valid publish topic'); - } else { node.warn('Payload or topic is undefined/null') } @@ -479,9 +478,9 @@ module.exports = function(RED) { node.on("input", function(msg, send, done) { const topic = node.topic || msg.topic; - if (topic.length > 0) { + if (typeof topic === "string" && topic.length > 0) { node.serverConnection.ack(topic, msg.messageId, msg.transaction); - } else if (typeof topic !== "string") { + } else if (typeof topic === "string" && topic.length == 0) { node.warn('No valid publish topic'); } else { node.warn('Payload or topic is undefined/null') diff --git a/parsers/base64/70-base64.js b/parsers/base64/70-base64.js index b0cb98a4..a6e1790f 100644 --- a/parsers/base64/70-base64.js +++ b/parsers/base64/70-base64.js @@ -18,7 +18,7 @@ module.exports = function(RED) { } else if (node.action === "b64") { if ( typeof value === "string") { - var load = value.replace(/\s+/g,''); + let load = value.replace(/\s+/g,''); if (regexp.test(load) && (load.length % 4 === 0) ) { value = Buffer.from(load,'base64').toString(); RED.util.setMessageProperty(msg,node.property,value); @@ -37,7 +37,7 @@ module.exports = function(RED) { } else if (typeof value === "string") { // Take base64 string and make into binary buffer - var load = value.replace(/\s+/g,''); // remove any whitespace + let load = value.replace(/\s+/g,''); // remove any whitespace //var load = value.replace(/[\t\r\n\f]+/g,''); //var load = value; if ( regexp.test(load) && (load.length % 4 === 0) ) { diff --git a/utility/annotate-image/annotate.js b/utility/annotate-image/annotate.js index 3032594f..2d7532d1 100644 --- a/utility/annotate-image/annotate.js +++ b/utility/annotate-image/annotate.js @@ -93,7 +93,7 @@ module.exports = function(RED) { } } else if (annotation.labelLocation === "bottom") { - y = y + (10+h+(((defaultLineWidth*0.5)+(Number(defaultFontSize))))); + y = y + (10+h+((defaultLineWidth*0.5)+(Number(defaultFontSize)))); ctx.textBaseline = "bottom"; } diff --git a/utility/exif/94-exif.js b/utility/exif/94-exif.js index 7ea1c6f6..c290d697 100644 --- a/utility/exif/94-exif.js +++ b/utility/exif/94-exif.js @@ -2,11 +2,11 @@ module.exports = function(RED) { "use strict"; - function convertDegreesMinutesSecondsToDecimals(degrees, minutes, seconds) { - var result; - result = degrees + (minutes / 60) + (seconds / 3600); - return result; - } + // function convertDegreesMinutesSecondsToDecimals(degrees, minutes, seconds) { + // var result; + // result = degrees + (minutes / 60) + (seconds / 3600); + // return result; + // } function ExifNode(n) { RED.nodes.createNode(this,n);