不要怂,就是干,撸起袖子干!

Commit 540d965d by Nuno Sousa

Add missing space to if statements

1 parent 6fa22d6f
Showing with 4 additions and 4 deletions
...@@ -115,12 +115,12 @@ module.exports = (function() { ...@@ -115,12 +115,12 @@ module.exports = (function() {
} else { } else {
// Postgres will treat tables as case-insensitive, so fix the case // Postgres will treat tables as case-insensitive, so fix the case
// of the returned values to match attributes // of the returned values to match attributes
if(this.options.raw === false && this.sequelize.options.quoteIdentifiers === false) { if (this.options.raw === false && this.sequelize.options.quoteIdentifiers === false) {
var attrsMap = Utils._.reduce(this.callee.attributes, function(m, v, k) { m[k.toLowerCase()] = k; return m}, {}) var attrsMap = Utils._.reduce(this.callee.attributes, function(m, v, k) { m[k.toLowerCase()] = k; return m}, {})
rows.forEach(function(row) { rows.forEach(function(row) {
Utils._.keys(row).forEach(function(key) { Utils._.keys(row).forEach(function(key) {
var targetAttr = attrsMap[key] var targetAttr = attrsMap[key]
if(targetAttr != key) { if (targetAttr != key) {
row[targetAttr] = row[key] row[targetAttr] = row[key]
delete row[key] delete row[key]
} }
...@@ -141,7 +141,7 @@ module.exports = (function() { ...@@ -141,7 +141,7 @@ module.exports = (function() {
} else if (this.send('isShowOrDescribeQuery')) { } else if (this.send('isShowOrDescribeQuery')) {
this.emit('success', results) this.emit('success', results)
} else if (this.send('isInsertQuery')) { } else if (this.send('isInsertQuery')) {
if(this.callee !== null) { // may happen for bulk inserts if (this.callee !== null) { // may happen for bulk inserts
for (var key in rows[0]) { for (var key in rows[0]) {
if (rows[0].hasOwnProperty(key)) { if (rows[0].hasOwnProperty(key)) {
var record = rows[0][key] var record = rows[0][key]
...@@ -156,7 +156,7 @@ module.exports = (function() { ...@@ -156,7 +156,7 @@ module.exports = (function() {
} else if ([QueryTypes.BULKUPDATE, QueryTypes.BULKDELETE].indexOf(this.options.type) !== -1) { } else if ([QueryTypes.BULKUPDATE, QueryTypes.BULKDELETE].indexOf(this.options.type) !== -1) {
this.emit('success', result.rowCount) this.emit('success', result.rowCount)
} else if (this.send('isUpdateQuery')) { } else if (this.send('isUpdateQuery')) {
if(this.callee !== null) { // may happen for bulk updates if (this.callee !== null) { // may happen for bulk updates
for (var key in rows[0]) { for (var key in rows[0]) {
if (rows[0].hasOwnProperty(key)) { if (rows[0].hasOwnProperty(key)) {
var record = rows[0][key] var record = rows[0][key]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!