fix linting for grunt

This commit is contained in:
Dave Conway-Jones 2021-03-12 09:36:20 +00:00
parent c4a32cdb58
commit f7be874e2c
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
3 changed files with 9 additions and 7 deletions

View File

@ -470,11 +470,12 @@ module.exports = function(RED) {
if (stanza.attrs.type === 'error') { if (stanza.attrs.type === 'error') {
var error = stanza.getChild('error'); var error = stanza.getChild('error');
if (error.attrs.code) { if (error.attrs.code) {
var reas = "";
try { try {
var reas = error.toString().split('><')[1].split(" xml")[0].trim(); reas = error.toString().split('><')[1].split(" xml")[0].trim();
if (reas == "registration-required") { reas = "membership-required"; } if (reas == "registration-required") { reas = "membership-required"; }
} }
catch(e) {}; catch(e) {}
var msg = { var msg = {
topic:stanza.attrs.from, topic:stanza.attrs.from,
payload: { payload: {
@ -692,11 +693,12 @@ module.exports = function(RED) {
if (stanza.attrs.type === 'error') { if (stanza.attrs.type === 'error') {
var error = stanza.getChild('error'); var error = stanza.getChild('error');
if (error.attrs.code) { if (error.attrs.code) {
var reas = "";
try { try {
var reas = error.toString().split('><')[1].split(" xml")[0].trim(); reas = error.toString().split('><')[1].split(" xml")[0].trim();
if (reas == "registration-required") { reas = "membership-required"; } if (reas == "registration-required") { reas = "membership-required"; }
} }
catch(e) {}; catch(e) {}
var msg = { var msg = {
topic:stanza.attrs.from, topic:stanza.attrs.from,
payload: { payload: {

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-node-xmpp", "name": "node-red-node-xmpp",
"version": "0.5.0", "version": "0.5.1",
"description": "A Node-RED node to talk to an XMPP server", "description": "A Node-RED node to talk to an XMPP server",
"dependencies": { "dependencies": {
"@xmpp/client": "^0.12.0" "@xmpp/client": "^0.12.0"

View File

@ -99,7 +99,7 @@ describe('RPI GPIO Node', function() {
var n2 = helper.getNode("n2"); var n2 = helper.getNode("n2");
n2.on("input", function(msg) { n2.on("input", function(msg) {
try { try {
msg.should.have.property('topic', 'pi/7'); msg.should.have.property('topic', 'gpio/7');
msg.should.have.property('payload', 1); msg.should.have.property('payload', 1);
done(); done();
} catch(err) { } catch(err) {
@ -117,7 +117,7 @@ describe('RPI GPIO Node', function() {
var n2 = helper.getNode("n2"); var n2 = helper.getNode("n2");
n2.on("input", function(msg) { n2.on("input", function(msg) {
try { try {
msg.should.have.property('topic', 'pi/11'); msg.should.have.property('topic', 'gpio/11');
msg.should.have.property('payload', 0); msg.should.have.property('payload', 0);
done(); done();
} catch(err) { } catch(err) {