1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

ignore Eclipse files and resolve some Eclipse JSHint warnings

squashed 4 commits into 1
This commit is contained in:
drwoods 2015-04-06 12:26:49 -04:00
parent 6f84526364
commit 98e3ff014e
4 changed files with 25 additions and 12 deletions

21
.gitignore vendored
View File

@ -1,12 +1,17 @@
node_modules
credentials.json
flows*.json
.config.json
.dist
.jshintignore
.jshintrc
.npm
.project
.sessions.json
.settings
.tern-project
*.backup
*_cred*
coverage
credentials.json
flows*.json
nodes/node-red-nodes/
.npm
/coverage
.config.json
.sessions.json
node_modules
public
.dist

7
.npmignore Normal file
View File

@ -0,0 +1,7 @@
.settings
.jshintignore
.jshintrc
.project
.tern-project
.travis.yml
.git

View File

@ -121,10 +121,10 @@ module.exports = function(RED) {
node.board.pinMode(node.pin, node.state);
node.on("input", function(msg) {
if (node.state === "OUTPUT") {
if ((msg.payload == true)||(msg.payload == 1)||(msg.payload.toString().toLowerCase() == "on")) {
if ((msg.payload === true)||(msg.payload == 1)||(msg.payload.toString().toLowerCase() == "on")) {
node.board.digitalWrite(node.pin, true);
}
if ((msg.payload == false)||(msg.payload == 0)||(msg.payload.toString().toLowerCase() == "off")) {
if ((msg.payload === false)||(msg.payload === 0)||(msg.payload.toString().toLowerCase() == "off")) {
node.board.digitalWrite(node.pin, false);
}
}

View File

@ -163,6 +163,7 @@ module.exports = function(RED) {
if (this.mongoConfig) {
var node = this;
var selector;
MongoClient.connect(this.mongoConfig.url, function(err,db) {
if (err) {
node.error(err);
@ -183,7 +184,7 @@ module.exports = function(RED) {
}
if (node.operation === "find") {
msg.projection = msg.projection || {};
var selector = ensureValidSelectorObject(msg.payload);
selector = ensureValidSelectorObject(msg.payload);
var limit = msg.limit;
if (typeof limit === "string" && !isNaN(limit)) {
limit = Number(limit);
@ -206,7 +207,7 @@ module.exports = function(RED) {
}
});
} else if (node.operation === "count") {
var selector = ensureValidSelectorObject(msg.payload);
selector = ensureValidSelectorObject(msg.payload);
coll.count(selector, function(err, count) {
if (err) {
node.error(err);