Skip to content

Commit 93afffe

Browse files
jshint: missing semicolon
1 parent 3b850e8 commit 93afffe

10 files changed

+64
-64
lines changed

lib/dialect/mssql.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Mssql.prototype.visitAlter = function(alter) {
104104
var table = self._queryNode.table;
105105
var result = ['EXEC sp_rename '+self.visit(table.toNode())+', '+self.visit(alter.nodes[0].nodes[0])];
106106
self._visitingAlter = false;
107-
return result
107+
return result;
108108
}
109109

110110
// Implement our own rename column:
@@ -119,7 +119,7 @@ Mssql.prototype.visitAlter = function(alter) {
119119
"'COLUMN'"
120120
];
121121
self._visitingAlter = false;
122-
return result
122+
return result;
123123
}
124124

125125
if (isAlterAddColumn(alter)) return _addColumn();
@@ -133,7 +133,7 @@ Mssql.prototype.visitAlter = function(alter) {
133133
// CASE WHEN true THEN xxx END
134134
// the "true" has to be a boolean expression like 1=1
135135
Mssql.prototype.visitCase = function(caseExp) {
136-
var _this=this
136+
var _this=this;
137137

138138
function _whenValue(node){
139139
if (node.type!='PARAMETER') return _this.visit(node);
@@ -163,20 +163,20 @@ Mssql.prototype.visitCase = function(caseExp) {
163163

164164
text += ' END)';
165165
return [text];
166-
}
166+
};
167167

168168
Mssql.prototype.visitColumn = function(columnNode) {
169169
var self=this;
170170
var table;
171171
var inSelectClause;
172172

173173
function _arrayAgg(){
174-
throw new Error("SQL Server does not support array_agg.")
174+
throw new Error("SQL Server does not support array_agg.");
175175
}
176176

177177
function _countStar(){
178178
// Implement our own since count(table.*) is invalid in Mssql
179-
var result='COUNT(*)'
179+
var result='COUNT(*)';
180180
if(inSelectClause && columnNode.alias) {
181181
result += ' AS ' + self.quote(columnNode.alias);
182182
}
@@ -193,8 +193,8 @@ Mssql.prototype.visitColumn = function(columnNode) {
193193

194194

195195
Mssql.prototype.visitCreate = function(create) {
196-
var isNotExists=isCreateIfNotExists(create)
197-
var isTemporary=isCreateTemporary(create)
196+
var isNotExists=isCreateIfNotExists(create);
197+
var isTemporary=isCreateTemporary(create);
198198
if (!isNotExists && !isTemporary) {
199199
return Mssql.super_.prototype.visitCreate.call(this, create);
200200
}
@@ -219,7 +219,7 @@ Mssql.prototype.visitCreate = function(create) {
219219
// if (schema) { whereClause+=' AND TABLE_SCHEMA = schemaResult.join(' ')}
220220
// Add some tests for this as well
221221

222-
if (!isNotExists) return createResult
222+
if (!isNotExists) return createResult;
223223
return ['IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.TABLES '+whereClause+') BEGIN '+createResult.join(' ')+' END'];
224224
};
225225

@@ -246,9 +246,9 @@ Mssql.prototype.visitDrop = function(drop) {
246246

247247
Mssql.prototype.visitFunctionCall = function(functionCall) {
248248
this._visitingFunctionCall = true;
249-
var name=functionCall.name
249+
var name=functionCall.name;
250250
// override the LENGTH function since mssql calls it LEN
251-
if (name=="LENGTH") name="LEN"
251+
if (name=="LENGTH") name="LEN";
252252
var txt = name + '(' + functionCall.nodes.map(this.visit.bind(this)).join(', ') + ')';
253253
this._visitingFunctionCall = false;
254254
return [txt];
@@ -385,7 +385,7 @@ Mssql.prototype.visitSelect = function(select) {
385385

386386
// Node is either an OFFSET or LIMIT node
387387
function getModifierValue(dialect,node){
388-
return node.count.type ? dialect.visit(node.count) : node.count
388+
return node.count.type ? dialect.visit(node.count) : node.count;
389389
}
390390

391391
function isAlterAddColumn(alter){
@@ -426,7 +426,7 @@ function isCreateIfNotExists(create){
426426
};
427427

428428
function isCreateTemporary(create){
429-
return create.options.isTemporary
429+
return create.options.isTemporary;
430430
};
431431

432432
function isDropIfExists(drop){

lib/dialect/mysql.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,6 @@ Mysql.prototype.visitBinary = function(binary) {
100100
return [text];
101101
}
102102
return Mysql.super_.prototype.visitBinary.call(this, binary);
103-
}
103+
};
104104

105105
module.exports = Mysql;

lib/dialect/oracle.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Oracle.prototype.visitDrop = function(drop) {
7575
};
7676

7777
Oracle.prototype.visitCreate = function(create) {
78-
var isNotExists=isCreateIfNotExists(create)
78+
var isNotExists=isCreateIfNotExists(create);
7979
//var isTemporary=isCreateTemporary(create)
8080
var createText = Oracle.super_.prototype.visitCreate.call(this, create);
8181
if (isNotExists) {
@@ -145,20 +145,20 @@ Oracle.prototype.visitQueryHelper=function(actions,targets,filters){
145145
}
146146

147147
return this.output;
148-
}
148+
};
149149

150150
Oracle.prototype.visitColumn = function(columnNode) {
151151
var self=this;
152152
var table;
153153
var inSelectClause;
154154

155155
function _arrayAgg(){
156-
throw new Error("Oracle does not support array_agg.")
156+
throw new Error("Oracle does not support array_agg.");
157157
}
158158

159159
function _countStar(){
160160
// Implement our own since count(table.*) is invalid in Oracle
161-
var result='COUNT(*)'
161+
var result='COUNT(*)';
162162
if(inSelectClause && columnNode.alias) {
163163
result += self._aliasText + self.quote(columnNode.alias);
164164
}
@@ -222,7 +222,7 @@ Oracle.prototype.visitDropIndex = function(node) {
222222
Oracle.prototype.visitCase = function(caseExp) {
223223

224224
return Mssql.prototype.visitCase.call(this, caseExp);
225-
}
225+
};
226226

227227

228228
function isCreateIfNotExists(create){
@@ -232,7 +232,7 @@ function isCreateIfNotExists(create){
232232
};
233233

234234
function isCreateTemporary(create){
235-
return create.options.isTemporary
235+
return create.options.isTemporary;
236236
};
237237

238238
function isDropIfExists(drop){

lib/dialect/postgres.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,14 @@ Postgres.prototype.quote = function(word, quoteCharacter) {
187187
}
188188
// handle square brackets specially
189189
if (q=='['){
190-
return '['+word+']'
190+
return '['+word+']';
191191
} else {
192192
return q + word.replace(new RegExp(q,'g'),q+q) + q;
193193
}
194194
};
195195

196196
Postgres.prototype.visitSelect = function(select) {
197-
var result = ['SELECT']
197+
var result = ['SELECT'];
198198

199199
if (select.isDistinct) result.push('DISTINCT');
200200

@@ -281,7 +281,7 @@ Postgres.prototype.visitCreate = function(create) {
281281
var col_nodes = table.columns.map(function(col) { return col.toNode(); });
282282

283283
var result = ['CREATE TABLE'];
284-
if (create.options.isTemporary) result=['CREATE TEMPORARY TABLE']
284+
if (create.options.isTemporary) result=['CREATE TEMPORARY TABLE'];
285285
result = result.concat(create.nodes.map(this.visit.bind(this)));
286286
result.push(this.visit(table.toNode()));
287287
var primary_col_nodes = col_nodes.filter(function(n) {
@@ -547,7 +547,7 @@ Postgres.prototype.visitCase = function(caseExp) {
547547

548548
text += ' END)';
549549
return [text];
550-
}
550+
};
551551

552552
Postgres.prototype.visitAt = function(at) {
553553
var text = '(' + this.visit(at.value) + ')[' + this.visit(at.index) + ']';
@@ -637,7 +637,7 @@ Postgres.prototype.visitQuery = function(queryNode) {
637637
throw new Error('Create View requires a Select.');
638638
}
639639
}
640-
return this.visitQueryHelper(actions,targets,filters)
640+
return this.visitQueryHelper(actions,targets,filters);
641641
};
642642

643643
/**
@@ -649,7 +649,7 @@ Postgres.prototype.visitQuery = function(queryNode) {
649649
* @returns {String[]}
650650
*/
651651
Postgres.prototype.visitQueryHelper=function(actions,targets,filters){
652-
this.handleDistinct(actions, filters)
652+
this.handleDistinct(actions, filters);
653653
// lazy-man sorting
654654
var sortedNodes = actions.concat(targets).concat(filters);
655655
for(var i = 0; i < sortedNodes.length; i++) {
@@ -658,7 +658,7 @@ Postgres.prototype.visitQueryHelper=function(actions,targets,filters){
658658
}
659659
// implicit 'from'
660660
return this.output;
661-
}
661+
};
662662

663663
Postgres.prototype.visitSubquery = function(queryNode) {
664664
// create another query builder of the current class to build the subquery
@@ -786,7 +786,7 @@ Postgres.prototype.visitColumn = function(columnNode) {
786786
txt.push(' NOT NULL');
787787
}
788788
if (!columnNode.primaryKey && columnNode.unique) {
789-
txt.push(' UNIQUE')
789+
txt.push(' UNIQUE');
790790
}
791791
}
792792

@@ -817,7 +817,7 @@ Postgres.prototype.visitColumn = function(columnNode) {
817817
var onDelete = columnNode.references.onDelete;
818818
if (onDelete) onDelete = onDelete.toUpperCase();
819819
if (onDelete === 'CASCADE' || onDelete === 'RESTRICT') {
820-
txt.push(' ON DELETE ' + onDelete)
820+
txt.push(' ON DELETE ' + onDelete);
821821
}
822822
}
823823
}
@@ -1006,8 +1006,8 @@ Postgres.prototype.findNode=function(list,type) {
10061006
var n=list[i];
10071007
if (n.type==type) return {index:i,node:n};
10081008
}
1009-
return undefined
1010-
}
1009+
return undefined;
1010+
};
10111011

10121012
/**
10131013
* pulls the DISTINCT node out of the filters and flags the SELECT node that it should be distinct.
@@ -1017,11 +1017,11 @@ Postgres.prototype.handleDistinct = function(actions,filters) {
10171017
var distinctNode = this.findNode(filters,"DISTINCT");
10181018
//if (!distinctNode) distinctNode = _findNode(targets,"DISTINCT");
10191019
//if (!distinctNode) distinctNode = _findNode(actions,"DISTINCT");
1020-
if (!distinctNode) return
1020+
if (!distinctNode) return;
10211021
var selectInfo = this.findNode(actions,"SELECT");
1022-
if (!selectInfo) return // there should be one by now, I think
1022+
if (!selectInfo) return; // there should be one by now, I think
10231023
// mark the SELECT node that it's distinct
10241024
selectInfo.node.isDistinct = true;
1025-
}
1025+
};
10261026

10271027
module.exports = Postgres;

lib/dialect/sqlite.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,28 @@ Sqlite.prototype.visitDropColumn = function() {
3838
};
3939

4040
Sqlite.prototype.visitFunctionCall = function(functionCall) {
41-
var _this=this
41+
var _this=this;
4242

4343
this._visitingFunctionCall = true;
4444

4545
function _left() {
4646
// convert LEFT(column,4) to SUBSTR(column,1,4)
47-
var nodes = functionCall.nodes.map(_this.visit.bind(_this))
48-
if (nodes.length != 2) throw new Error('Not enough parameters passed to LEFT function.')
47+
var nodes = functionCall.nodes.map(_this.visit.bind(_this));
48+
if (nodes.length != 2) throw new Error('Not enough parameters passed to LEFT function.');
4949
var txt = "SUBSTR(" + (nodes[0]+'') + ', 1, ' + (nodes[1]+'') + ')';
50-
return txt
50+
return txt;
5151
}
5252

5353
function _right() {
5454
// convert RIGHT(column,4) to SUBSTR(column,-4)
55-
var nodes = functionCall.nodes.map(_this.visit.bind(_this))
56-
if (nodes.length != 2) throw new Error('Not enough parameters passed to RIGHT function.')
55+
var nodes = functionCall.nodes.map(_this.visit.bind(_this));
56+
if (nodes.length != 2) throw new Error('Not enough parameters passed to RIGHT function.');
5757
var txt = "SUBSTR(" + (nodes[0]+'') + ', -' + (nodes[1]+'') + ')';
58-
return txt
58+
return txt;
5959
}
6060

61-
var txt=""
62-
var name=functionCall.name
61+
var txt="";
62+
var name=functionCall.name;
6363
// Override LEFT and RIGHT and convert to SUBSTR
6464
if (name == "LEFT") txt = _left();
6565
else if (name == "RIGHT") txt = _right();
@@ -123,6 +123,6 @@ Sqlite.prototype.visitBinary = function(binary) {
123123
return ret;
124124
}
125125
return Sqlite.super_.prototype.visitBinary.call(this, binary);
126-
}
126+
};
127127

128128
module.exports = Sqlite;

lib/node/valueExpression.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ var ValueExpressionMixin = function() {
110110
whenList : processParams(whenList),
111111
thenList : processParams(thenList),
112112
else : elseBranch
113-
})
114-
}
113+
});
114+
};
115115

116116
return {
117117
isNull : postfixUnaryMethod('IS NULL'),

lib/table.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var Table = function(config) {
1515
this._name = config.name;
1616
this._initialConfig = config;
1717
this.columnWhiteList = !!config.columnWhiteList;
18-
this.isTemporary=!!config.isTemporary
18+
this.isTemporary=!!config.isTemporary;
1919
this.snakeToCamel = !!config.snakeToCamel;
2020
this.columns = [];
2121
this.table = this;
@@ -76,10 +76,10 @@ Table.prototype.createColumn = function(col) {
7676
table: this,
7777
subfieldContainer: col,
7878
name: subfield
79-
})]
79+
})];
8080
}, this))
8181
.object()
82-
.value()
82+
.value();
8383
}
8484
}
8585

runtests.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
var childProcess = require("child_process")
2-
var path = require("path")
1+
var childProcess = require("child_process");
2+
var path = require("path");
33

4-
var env = process.env
5-
env.NODE_ENV = "test"
4+
var env = process.env;
5+
env.NODE_ENV = "test";
66

77
var options = {
88
env: env
9-
}
9+
};
1010

11-
var command = path.join(".", "node_modules", ".bin", "mocha")
12-
if (process.platform == "win32") command += ".cmd"
13-
var run = childProcess.spawn(command, [], options)
14-
run.stdout.pipe(process.stdout)
15-
run.stderr.pipe(process.stderr)
11+
var command = path.join(".", "node_modules", ".bin", "mocha");
12+
if (process.platform == "win32") command += ".cmd";
13+
var run = childProcess.spawn(command, [], options);
14+
run.stdout.pipe(process.stdout);
15+
run.stderr.pipe(process.stderr);
1616
run.on('close', function(code) {
17-
process.exit(code)
18-
})
17+
process.exit(code);
18+
});

test/column-tests.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ describe('column', function() {
9696
columns: ['id', 'name']
9797
});
9898
it('throws for insert properties that are not a column', function() {
99-
assert.throws(function() { table.insert({id:0, _private:'_private', name:'name'}) }, Error);
99+
assert.throws(function() { table.insert({id:0, _private:'_private', name:'name'}); }, Error);
100100
});
101101
it('throws for update properties that are not a column', function() {
102-
assert.throws(function() { table.update({id:0, _private:'_private', name:'name'}) }, Error);
102+
assert.throws(function() { table.update({id:0, _private:'_private', name:'name'}); }, Error);
103103
});
104104
});
105105

test/dialects/subquery-tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Harness.test({
2929
string: 'SELECT "user"."name" FROM "user" WHERE ("user"."id" IN (SELECT "post"."userId" FROM "post"))'
3030
},
3131
params: []
32-
})
32+
});
3333

3434
Harness.test({
3535
query: user.name.in(

0 commit comments

Comments
 (0)