node-red-node-mysql
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -154,21 +154,22 @@ | ||
else { | ||
if (rows.constructor.name === "OkPacket") { | ||
msg.payload = JSON.parse(JSON.stringify(rows)); | ||
} | ||
else if (rows.constructor.name === "Array") { | ||
if (rows[0] && rows[0].constructor.name === "RowDataPacket") { | ||
msg.payload = rows.map(v => Object.assign({}, v)); | ||
} | ||
else if (rows[0] && rows[0].constructor.name === "Array") { | ||
if (rows[0][0] && rows[0][0].constructor.name === "RowDataPacket") { | ||
msg.payload = rows.map(function(v) { | ||
if (!Array.isArray(v)) { return v; } | ||
v.map(w => Object.assign({}, w)) | ||
}); | ||
} | ||
else { msg.payload = rows; } | ||
} | ||
else { msg.payload = rows; } | ||
} | ||
else { msg.payload = rows; } | ||
// if (rows.constructor.name === "OkPacket") { | ||
// msg.payload = JSON.parse(JSON.stringify(rows)); | ||
// } | ||
// else if (rows.constructor.name === "Array") { | ||
// if (rows[0] && rows[0].constructor.name === "RowDataPacket") { | ||
// msg.payload = rows.map(v => Object.assign({}, v)); | ||
// } | ||
// else if (rows[0] && rows[0].constructor.name === "Array") { | ||
// if (rows[0][0] && rows[0][0].constructor.name === "RowDataPacket") { | ||
// msg.payload = rows.map(function(v) { | ||
// if (!Array.isArray(v)) { return v; } | ||
// v.map(w => Object.assign({}, w)) | ||
// }); | ||
// } | ||
// else { msg.payload = rows; } | ||
// } | ||
// else { msg.payload = rows; } | ||
// } | ||
// else { msg.payload = rows; } | ||
msg.payload = rows; | ||
send(msg); | ||
@@ -175,0 +176,0 @@ status = {fill:"green",shape:"dot",text:"OK"}; |
{ | ||
"name": "node-red-node-mysql", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "A Node-RED node to read and write to a MySQL database", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
16270
197