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

Merge pull request #606 from drwoods/master

Ignore Eclipse project files and fix some jshint warnings
This commit is contained in:
Nick O'Leary 2015-04-14 21:34:23 +01:00
commit 937f26da41
4 changed files with 25 additions and 12 deletions

21
.gitignore vendored
View File

@ -1,12 +1,17 @@
node_modules .config.json
credentials.json .dist
flows*.json .jshintignore
.jshintrc
.npm
.project
.sessions.json
.settings
.tern-project
*.backup *.backup
*_cred* *_cred*
coverage
credentials.json
flows*.json
nodes/node-red-nodes/ nodes/node-red-nodes/
.npm node_modules
/coverage
.config.json
.sessions.json
public 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.board.pinMode(node.pin, node.state);
node.on("input", function(msg) { node.on("input", function(msg) {
if (node.state === "OUTPUT") { 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); 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); node.board.digitalWrite(node.pin, false);
} }
} }

View File

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