From e20cf97fce984f2e9774c6cba585b5d47b0b53b4 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Sun, 11 Aug 2019 13:37:15 +0100 Subject: [PATCH] A whole bunch of whitespace linting - no functional changes --- function/rbe/rbe.js | 2 +- hardware/Arduino/35-arduino.js | 4 +- hardware/PiGpio/36-rpi-gpio.js | 20 +-- hardware/PiLcd/pilcd.js | 2 +- hardware/heatmiser/100-heatmiser.js | 37 ------ hardware/scanBLE/101-scanBLE.js | 2 +- hardware/sensorTag/79-sensorTag.js | 16 ++- io/emoncms/88-emoncms.js | 12 +- io/serialport/25-serial.js | 20 +-- io/serialport/package.json | 2 +- io/stomp/18-stomp.js | 1 - parsers/geohash/70-geohash.js | 2 +- parsers/smaz/smaz.js | 190 ++++++++++++++-------------- social/email/61-email.js | 6 +- social/notify/57-notify.js | 2 +- social/pushbullet/57-pushbullet.js | 6 +- social/pushover/57-pushover.js | 2 +- social/twitter/27-twitter.js | 2 +- storage/sqlite/sqlite.js | 8 +- utility/exif/94-exif.js | 2 +- 20 files changed, 154 insertions(+), 184 deletions(-) diff --git a/function/rbe/rbe.js b/function/rbe/rbe.js index 7a821868..e4d9500a 100644 --- a/function/rbe/rbe.js +++ b/function/rbe/rbe.js @@ -21,7 +21,7 @@ module.exports = function(RED) { this.on("input",function(msg) { if (msg.hasOwnProperty("reset")) { if (msg.hasOwnProperty("topic") && (typeof msg.topic === "string") && (msg.topic !== "")) { - delete node.previous[msg.topic]; + delete node.previous[msg.topic]; } else { node.previous = {}; } } diff --git a/hardware/Arduino/35-arduino.js b/hardware/Arduino/35-arduino.js index 1a43637b..465fe007 100644 --- a/hardware/Arduino/35-arduino.js +++ b/hardware/Arduino/35-arduino.js @@ -179,8 +179,8 @@ module.exports = function(RED) { node.board.sysexCommand(msg.payload); } if (node.state === "STRING") { - node.board.sendString(msg.payload.toString()); - } + node.board.sendString(msg.payload.toString()); + } } }); node.board.once('disconnect', function() { diff --git a/hardware/PiGpio/36-rpi-gpio.js b/hardware/PiGpio/36-rpi-gpio.js index 0dd92d0e..089ab7dd 100644 --- a/hardware/PiGpio/36-rpi-gpio.js +++ b/hardware/PiGpio/36-rpi-gpio.js @@ -92,7 +92,7 @@ module.exports = function(RED) { var val; if (node.intype == "up") { val = 1; } if (node.intype == "down") { val = 0; } - setTimeout(function(){ + setTimeout(function() { node.send({ topic:"pi/"+node.pin, payload:val }); node.status({fill:"grey",shape:"dot",text:RED._("rpi-gpio.status.na",{value:val})}); },250); @@ -194,7 +194,7 @@ module.exports = function(RED) { } else { node.status({fill:"grey",shape:"dot",text:"node-red:rpi-gpio.status.not-available"}); - node.on("input", function(msg){ + node.on("input", function(msg) { node.status({fill:"grey",shape:"dot",text:RED._("rpi-gpio.status.na",{value:msg.payload.toString()})}); }); } @@ -303,14 +303,14 @@ module.exports = function(RED) { }); node.on("close", function(done) { - node.status({}); - if (node.child != null) { - node.finished = done; - node.child.kill('SIGINT'); - node.child = null; - } - else { done(); } - }); + node.status({}); + if (node.child != null) { + node.finished = done; + node.child.kill('SIGINT'); + node.child = null; + } + else { done(); } + }); } else { node.status({fill:"grey",shape:"dot",text:"node-red:rpi-gpio.status.not-available"}); diff --git a/hardware/PiLcd/pilcd.js b/hardware/PiLcd/pilcd.js index 2dcfd72b..f40041ae 100644 --- a/hardware/PiLcd/pilcd.js +++ b/hardware/PiLcd/pilcd.js @@ -90,7 +90,7 @@ module.exports = function(RED) { } else { node.status({fill:"grey",shape:"dot",text:"node-red:rpi-gpio.status.not-available"}); - node.on("input", function(msg){ + node.on("input", function(msg) { node.status({fill:"grey",shape:"dot",text:RED._("node-red:rpi-gpio.status.na",{value:msg.payload.toString()})}); }); } diff --git a/hardware/heatmiser/100-heatmiser.js b/hardware/heatmiser/100-heatmiser.js index e9f311fe..fb4287fd 100644 --- a/hardware/heatmiser/100-heatmiser.js +++ b/hardware/heatmiser/100-heatmiser.js @@ -145,43 +145,6 @@ module.exports = function(RED) { break; } - //case "holiday" : { - //if (DEBUG) { - //hminnode.log("Hit the holiday case"); - //} - //if (!('enabled' in message.payload[key]) && !('time' in message.payload[key])) { - //hminnode.log("Warning: Unsupported 'holiday' value passed!"); - //eturn; - //} - //var time = message.payload[key].time; - //// Ensure hminnode time is a date - //if (typeof(time) == "string") { - //hminnode.log("Typeof time was " +typeof(message.payload[key].time)); - //// message.payload[key].time = new Date(message.payload[key].time); - //message.payload[key].time = new Date(2014, 02, 15, 12, 0, 0); - //hminnode.log("Typeof time is now " +typeof(message.payload[key].time)); - //} - //// Also add in away mode (for hot water) if we're on hols - //if (message.payload[key].time) { - //message.payload.away_mode = 1; - //} - //else { - //message.payload.away_mode = 0; - //} - //break; - // } - - //case "hotwater" : { - //if (DEBUG) { - //hminnode.log("Hit the hotwater case"); - //} - //if (message.payload[key] !== "on" && message.payload[key] !== "boost" && message.payload[key] !== "off") { - //hminnode.log("Warning: Unsupported 'hotwater' value passed!"); - //return; - //} - //break; - // } - case "heating" : { // Ensure heating stays last! It's got a multi write scenario if (DEBUG) { diff --git a/hardware/scanBLE/101-scanBLE.js b/hardware/scanBLE/101-scanBLE.js index ffe129e8..1b102b39 100644 --- a/hardware/scanBLE/101-scanBLE.js +++ b/hardware/scanBLE/101-scanBLE.js @@ -1,5 +1,5 @@ - module.exports = function(RED) { +module.exports = function(RED) { "use strict"; //import noble diff --git a/hardware/sensorTag/79-sensorTag.js b/hardware/sensorTag/79-sensorTag.js index bc3a8c89..b197c7d1 100644 --- a/hardware/sensorTag/79-sensorTag.js +++ b/hardware/sensorTag/79-sensorTag.js @@ -44,10 +44,13 @@ module.exports = function(RED) { sensorTag.enableIrTemperature(function() {}); sensorTag.on('irTemperatureChange', function(objectTemperature, ambientTemperature) { - var msg = {'topic': node.topic + '/temperature'}; - msg.payload = {'object': +objectTemperature.toFixed(1), - 'ambient': +ambientTemperature.toFixed(1) - }; + var msg = { + 'topic': node.topic + '/temperature', + 'payload': { + 'object': +objectTemperature.toFixed(1), + 'ambient': +ambientTemperature.toFixed(1) + } + } node.send(msg); }); sensorTag.enableBarometricPressure(function() {}); @@ -59,8 +62,9 @@ module.exports = function(RED) { sensorTag.enableHumidity(function() {}); sensorTag.on('humidityChange', function(temp, humidity) { var msg = {'topic': node.topic + '/humidity'}; - msg.payload = {'temperature': +temp.toFixed(1), - 'humidity': +humidity.toFixed(1) + msg.payload = { + 'temperature': +temp.toFixed(1), + 'humidity': +humidity.toFixed(1) }; if ((temp !== -40) || (humidity !== 100)) { node.send(msg); diff --git a/io/emoncms/88-emoncms.js b/io/emoncms/88-emoncms.js index b947e344..0a2814ea 100644 --- a/io/emoncms/88-emoncms.js +++ b/io/emoncms/88-emoncms.js @@ -30,7 +30,7 @@ module.exports = function(RED) { this.on("input", function(msg) { // setup the data for the URI - if (this.datatype == "legacy"){ + if (this.datatype == "legacy") { this.url = this.baseurl + '/input/post.json?'; if (typeof(msg.payload) !== "string") { this.url += 'json=' + JSON.stringify(msg.payload); @@ -44,15 +44,15 @@ module.exports = function(RED) { } } } - else if (this.datatype == "fulljson"){ + else if (this.datatype == "fulljson") { this.url = this.baseurl + '/input/post?'; this.url += 'fulljson=' + encodeURIComponent(JSON.stringify(msg.payload)); } - else if (this.datatype == "json"){ + else if (this.datatype == "json") { this.url = this.baseurl + '/input/post?'; this.url += 'json={' + encodeURIComponent(msg.payload) + '}'; } - else if (this.datatype == "CSV"){ + else if (this.datatype == "CSV") { this.url = this.baseurl + '/input/post?'; this.url += 'csv=' + msg.payload; } @@ -80,7 +80,7 @@ module.exports = function(RED) { // node.warn("WARN: Time object undefined, no time set"); } else { - if (!isNaN(msg.time)) { + if (!isNaN(msg.time)) { this.url += '&time=' + msg.time; } else { @@ -113,7 +113,7 @@ module.exports = function(RED) { try { msg.payload = JSON.parse(body); } - catch (e) { + catch (e) { msg.payload = body; } diff --git a/io/serialport/25-serial.js b/io/serialport/25-serial.js index 8267a337..e0d76a99 100644 --- a/io/serialport/25-serial.js +++ b/io/serialport/25-serial.js @@ -174,16 +174,16 @@ module.exports = function(RED) { return { get:function(serialConfig) { // make local copy of configuration -- perhaps not needed? - var port = serialConfig.serialport, - baud = serialConfig.serialbaud, - databits = serialConfig.databits, - parity = serialConfig.parity, - stopbits = serialConfig.stopbits, - newline = serialConfig.newline, - spliton = serialConfig.out, - waitfor = serialConfig.waitfor, + var port = serialConfig.serialport, + baud = serialConfig.serialbaud, + databits = serialConfig.databits, + parity = serialConfig.parity, + stopbits = serialConfig.stopbits, + newline = serialConfig.newline, + spliton = serialConfig.out, + waitfor = serialConfig.waitfor, binoutput = serialConfig.bin, - addchar = serialConfig.addchar, + addchar = serialConfig.addchar, responsetimeout = serialConfig.responsetimeout; var id = port; // just return the connection object if already have one @@ -320,6 +320,7 @@ module.exports = function(RED) { obj.serial.on('error', function(err) { RED.log.error(RED._("serial.errors.error",{port:port,error:err.toString()})); obj._emitter.emit('closed'); + if (obj.tout) { clearTimeout(obj.tout); } obj.tout = setTimeout(function() { setupSerial(); }, settings.serialReconnectTime); @@ -328,6 +329,7 @@ module.exports = function(RED) { if (!obj._closing) { RED.log.error(RED._("serial.errors.unexpected-close",{port:port})); obj._emitter.emit('closed'); + if (obj.tout) { clearTimeout(obj.tout); } obj.tout = setTimeout(function() { setupSerial(); }, settings.serialReconnectTime); diff --git a/io/serialport/package.json b/io/serialport/package.json index b78f3821..07a3601f 100644 --- a/io/serialport/package.json +++ b/io/serialport/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-serialport", - "version" : "0.8.3", + "version" : "0.8.4", "description" : "Node-RED nodes to talk to serial ports", "dependencies" : { "serialport" : "^7.1.5" diff --git a/io/stomp/18-stomp.js b/io/stomp/18-stomp.js index 311f9e35..8689a1e0 100644 --- a/io/stomp/18-stomp.js +++ b/io/stomp/18-stomp.js @@ -67,7 +67,6 @@ module.exports = function(RED) { node.log('subscribing to: '+node.topic); node.client.subscribe(node.topic, function(body, headers) { var newmsg={"headers":headers,"topic":node.topic} - try { newmsg.payload = JSON.parse(body); } diff --git a/parsers/geohash/70-geohash.js b/parsers/geohash/70-geohash.js index 233913e2..8d5e0e89 100644 --- a/parsers/geohash/70-geohash.js +++ b/parsers/geohash/70-geohash.js @@ -16,7 +16,7 @@ module.exports = function(RED) { var value = RED.util.getMessageProperty(msg,node.property); if (value !== undefined) { if (typeof value === "string") { - // try to decode it... + // try to decode it... var regexp = new RegExp('^[a-z0-9]{1,9}$'); // can only contain a-z or 0-9 and length 1-9 if (regexp.test(value)) { var po = geohash.decode(value); diff --git a/parsers/smaz/smaz.js b/parsers/smaz/smaz.js index 9529f9f0..d41624ed 100644 --- a/parsers/smaz/smaz.js +++ b/parsers/smaz/smaz.js @@ -4,14 +4,19 @@ // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -// * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -// * Neither the name of Smaz nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +// Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +// Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +// Neither the name of Smaz nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Our compression codebook - var rc = [ +var rc = [ " ", "the", "e", "t", "a", "of", "o", "and", "i", "n", "s", "e ", "r", " th", " t", "in", "he", "th", "h", "he ", "to", "\r\n", "l", "s ", "d", " a", "an","er", "c", " o", "d ", "on", " of", "re", "of ", "t ", ", ", "is", "u", "at", " ", "n ", "or", "which", "f", "m", "as", "it", "that", "\n", "was", "en", " ", " w", "es", " an", " i", "\r", "f ", "g", "p", "nd", " s", "nd ", "ed ", "w", "ed", "http://", "for", "te", "ing", "y ", "The", " c", "ti", "r ", "his", "st", " in", "ar", "nt", ",", " to", "y", "ng", " h", "with", "le", "al", "to ", "b", "ou", "be", "were", " b", "se", "o ", "ent", "ha", "ng ", "their", "\"", "hi", "from", " f", "in ", "de", "ion", "me", "v", ".", "ve", "all", "re ", "ri", "ro", "is ", "co", "f t", "are", "ea", ". ", "her", " m", "er ", " p", "es ", "by", "they", "di", "ra", "ic", "not", "s, ", "d t", "at ", "ce", "la", "h ", "ne", "as ", "tio", "on ", "n t", "io", "we", " a ", "om", ", a", "s o", "ur", "li", "ll", "ch", "had", "this", "e t", "g ", "e\r\n", " wh", "ere", " co", "e o", "a ", "us", " d", "ss", "\n\r\n", "\r\n\r", "=\"", " be", " e", "s a", "ma", "one", "t t", "or ", "but", "el", "so", "l ", "e s", "s,", "no", "ter", " wa", "iv", "ho", "e a", " r", "hat", "s t", "ns", "ch ", "wh", "tr", "ut", "/", "have", "ly ", "ta", " ha", " on", "tha", "-", " l", "ati", "en ", "pe", " re", "there", "ass", "si", " fo", "wa", "ec", "our", "who", "its", "z", "fo", "rs", ">", "ot", "un", "<", "im", "th ", "nc", "ate", "><", "ver", "ad", " we", "ly", "ee", " n", "id", " cl", "ac", "il", "", "=\'"]; var cb = rc.reduce(function(result, item, index, array) { @@ -20,103 +25,100 @@ var cb = rc.reduce(function(result, item, index, array) { }, {}) var smaz = module.exports = { - codebook: cb, - reverse_codebook: rc, - flush_verbatim: function(verbatim) { - var output = []; - if (verbatim.length > 1) { - output.push(255); - output.push(verbatim.length-1); - } else { - output.push(254); - } - var k = 0; - for (; k < verbatim.length; k++) { - output.push(verbatim.charCodeAt(k)); - } - return output; - }, + codebook: cb, + reverse_codebook: rc, + flush_verbatim: function(verbatim) { + var output = []; + if (verbatim.length > 1) { + output.push(255); + output.push(verbatim.length-1); + } else { + output.push(254); + } + var k = 0; + for (; k < verbatim.length; k++) { + output.push(verbatim.charCodeAt(k)); + } + return output; + }, - compress: function(input) { - var verbatim = ""; - var output = []; - var input_index = 0; + compress: function(input) { + var verbatim = ""; + var output = []; + var input_index = 0; - while (input_index < input.length) { - // Try to lookup substrings into the hash table, starting from the - // longer to the shorter substrings - var encoded = false; - var j = 7; + while (input_index < input.length) { + // Try to lookup substrings into the hash table, starting from the + // longer to the shorter substrings + var encoded = false; + var j = 7; - if (input.length-input_index < 7) { - j = input.length-input_index; - } + if (input.length-input_index < 7) { + j = input.length-input_index; + } - for (; j > 0; j--) { - var code = smaz.codebook[input.substr(input_index,j)]; - if (code != undefined) { - // Match found in the hash table, - // Flush verbatim bytes if needed - if (verbatim) { + for (; j > 0; j--) { + var code = smaz.codebook[input.substr(input_index,j)]; + if (code != undefined) { + // Match found in the hash table, + // Flush verbatim bytes if needed + if (verbatim) { + output = output.concat(smaz.flush_verbatim(verbatim)); + verbatim = ""; + } + // Emit the byte + output.push(code); + input_index += j; + encoded = true; + break; + } + } + if (!encoded) { + // Match not found - add the byte to the verbatim buffer + verbatim += input[input_index]; + input_index++; + // Flush if we reached the verbatim bytes length limit + if (verbatim.length == 256) { + output = output.concat(smaz.flush_verbatim(verbatim)); + verbatim = ""; + } + } + } + // Flush verbatim bytes if needed + if (verbatim) { output = output.concat(smaz.flush_verbatim(verbatim)); verbatim = ""; - } - // Emit the byte - output.push(code); - - input_index += j; - - encoded = true; - break; } - } - if (!encoded) { - // Match not found - add the byte to the verbatim buffer - verbatim += input[input_index]; - input_index++; + return new Uint8Array(output); + }, - // Flush if we reached the verbatim bytes length limit - if (verbatim.length == 256) { - output = output.concat(smaz.flush_verbatim(verbatim)); - verbatim = ""; + decompress: function(input) { + var output = ""; + var i = 0; + while (i < input.length) { + if (input[i] === 254) { + // Verbatim byte + if (i+1 >= input.length) { + throw "Malformed smaz."; + } + output += String.fromCharCode(input[i+1]); + i += 2; + } else if (input[i] === 255) { + // Verbatim string + var j; + if (i+input[i+1]+2 >= input.length) { + throw "Malformed smaz."; + } + for (j = 0; j < input[i+1]+1; j++) { + output += String.fromCharCode(input[i+2+j]); + } + i += 3+input[i+1]; + } else { + // Codebook entry + output += smaz.reverse_codebook[input[i]]; + i++; + } } - } + return output; } - // Flush verbatim bytes if needed - if (verbatim) { - output = output.concat(smaz.flush_verbatim(verbatim)); - verbatim = ""; - } - return new Uint8Array(output); - }, - - decompress: function(input) { - var output = ""; - var i = 0; - while (i < input.length) { - if (input[i] === 254) { - // Verbatim byte - if (i+1 >= input.length) { - throw "Malformed smaz."; - } - output += String.fromCharCode(input[i+1]); - i += 2; - } else if(input[i] === 255) { - // Verbatim string - var j; - if (i+input[i+1]+2 >= input.length) { - throw "Malformed smaz."; - } - for (j = 0; j < input[i+1]+1; j++) { - output += String.fromCharCode(input[i+2+j]); - } - i += 3+input[i+1]; - } else { - // Codebook entry - output += smaz.reverse_codebook[input[i]]; - i++; - } - } - return output; - } }; diff --git a/social/email/61-email.js b/social/email/61-email.js index 805b43f2..fcae9f23 100644 --- a/social/email/61-email.js +++ b/social/email/61-email.js @@ -55,7 +55,7 @@ module.exports = function(RED) { if (flag) { RED.nodes.addCredentials(n.id,{userid:this.userid, password:this.password, global:true}); } - if (n.tls === false){ + if (n.tls === false) { this.tls = false; } var node = this; @@ -289,7 +289,7 @@ module.exports = function(RED) { // and pass in the email message. The parser will signal when it has parsed the message. SimpleParser(data, {}, function(err, parsed) { //node.log(util.format("SimpleParser: on(end): %j", mailObject)); - if (err){ + if (err) { node.status({fill:"red", shape:"ring", text:"email.status.parseerror"}); node.error(RED._("email.errors.parsefail", {folder:node.box}), err); } @@ -391,7 +391,7 @@ module.exports = function(RED) { imapMessage.on('body', function(stream, info) { //console.log("> message - body - stream=?, info=%j", info); SimpleParser(stream, {}, function(err, parsed) { - if (err){ + if (err) { node.status({fill:"red", shape:"ring", text:"email.status.parseerror"}); node.error(RED._("email.errors.parsefail", {folder:node.box}),err); } diff --git a/social/notify/57-notify.js b/social/notify/57-notify.js index 873ef466..f20c4f07 100644 --- a/social/notify/57-notify.js +++ b/social/notify/57-notify.js @@ -10,7 +10,7 @@ module.exports = function(RED) { RED.nodes.createNode(this,n); this.title = n.title; var node = this; - + node.on("input",function(msg) { var title = node.title || msg.topic; if (typeof msg.payload === 'object') { diff --git a/social/pushbullet/57-pushbullet.js b/social/pushbullet/57-pushbullet.js index 9f52c185..5c49f222 100644 --- a/social/pushbullet/57-pushbullet.js +++ b/social/pushbullet/57-pushbullet.js @@ -519,10 +519,10 @@ module.exports = function(RED) { } }); - function filterdActiveDevices(devices){ + function filterdActiveDevices(devices) { var activeDevices = []; - for(var i=0;i 0) { bind = Array.isArray(msg.payload) ? msg.payload : []; @@ -84,7 +84,7 @@ module.exports = function(RED) { node.status({fill:"red", shape:"dot",text:"msg.topic error"}); } } - if (node.sqlquery == "fixed"){ + if (node.sqlquery == "fixed") { if (typeof node.sql === 'string') { if (node.sql.length > 0) { node.mydbConfig.db.all(node.sql, bind, function(err, row) { @@ -96,14 +96,14 @@ module.exports = function(RED) { }); } } - else{ + else { if (node.sql === null || node.sql == "") { node.error("SQL statement config not set up",msg); node.status({fill:"red",shape:"dot",text:"SQL config not set up"}); } } } - if (node.sqlquery == "prepared"){ + if (node.sqlquery == "prepared") { if (typeof node.sql === 'string' && typeof msg.params !== "undefined" && typeof msg.params === "object") { if (node.sql.length > 0) { node.mydbConfig.db.all(node.sql, msg.params, function(err, row) { diff --git a/utility/exif/94-exif.js b/utility/exif/94-exif.js index 2a783d1a..93ba0b3b 100644 --- a/utility/exif/94-exif.js +++ b/utility/exif/94-exif.js @@ -75,7 +75,7 @@ module.exports = function(RED) { else { if (exifData) { msg.exif = exifData; - if((exifData.hasOwnProperty("gps")) && (Object.keys(exifData.gps).length !== 0)) { + if ((exifData.hasOwnProperty("gps")) && (Object.keys(exifData.gps).length !== 0)) { addMsgLocationDataFromExifGPSData(msg); } //else { node.log("The incoming image did not contain Exif GPS data."); }