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

Commit 72d2737b by terraflubb

Minor low-hanging changes to improve jshint performance

1 parent 42a44f10
Showing with 8 additions and 8 deletions
......@@ -15,7 +15,7 @@ var processAndEscapeValue = function(value) {
module.exports = (function() {
var QueryGenerator = {
addSchema: function(opts) {
var tableName = undefined
var tableName
var schema = (!!opts && !!opts.options && !!opts.options.schema ? opts.options.schema : undefined)
var schemaDelimiter = (!!opts && !!opts.options && !!opts.options.schemaDelimiter ? opts.options.schemaDelimiter : undefined)
......@@ -141,7 +141,7 @@ module.exports = (function() {
var query = "ALTER TABLE `<%= tableName %>` CHANGE <%= attributes %>;"
var attrString = []
for (attrName in attributes) {
for (var attrName in attributes) {
var definition = attributes[attrName]
attrString.push(Utils._.template('`<%= attrName %>` `<%= attrName %>` <%= definition %>')({
......@@ -291,7 +291,7 @@ module.exports = (function() {
options = options || {}
var table = QueryGenerator.addQuotes(tableName)
var where = QueryGenerator.getWhereConditions(where)
where = QueryGenerator.getWhereConditions(where)
var limit = ""
if(Utils._.isUndefined(options.limit)) {
......@@ -311,7 +311,7 @@ module.exports = (function() {
options = options || {}
var table = QueryGenerator.addQuotes(tableName)
var where = QueryGenerator.getWhereConditions(where)
where = QueryGenerator.getWhereConditions(where)
var query = "DELETE FROM " + table + " WHERE " + where
......@@ -331,8 +331,8 @@ module.exports = (function() {
}
var table = QueryGenerator.addQuotes(tableName)
var values = values.join(",")
var where = QueryGenerator.getWhereConditions(where)
values = values.join(",")
where = QueryGenerator.getWhereConditions(where)
var query = "UPDATE " + table + " SET " + values + " WHERE " + where
......@@ -431,7 +431,7 @@ module.exports = (function() {
if (Array.isArray(value)) {
// is value an array?
if (value.length == 0) { value = [null] }
if (value.length === 0) { value = [null] }
_value = "(" + value.map(function(subValue) {
return Utils.escape(subValue);
}).join(',') + ")"
......@@ -481,7 +481,7 @@ module.exports = (function() {
template += " auto_increment"
}
if ((dataType.defaultValue != undefined) && (dataType.defaultValue != DataTypes.NOW)) {
if ((dataType.defaultValue !== undefined) && (dataType.defaultValue != DataTypes.NOW)) {
template += " DEFAULT " + Utils.escape(dataType.defaultValue)
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!