Skip to content

Commit 3acb273

Browse files
committed
lint: fix comma spacing
1 parent 8d92c2b commit 3acb273

File tree

6 files changed

+18
-17
lines changed

6 files changed

+18
-17
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
},
55
"rules": {
66
"comma-dangle": [2, "never"],
7+
"comma-spacing": ["error", { "before": false, "after": true }],
78
"consistent-return": 2,
89
"eqeqeq": [2, "allow-null"],
910
"indent": [2, 2, { "VariableDeclarator": 2, "SwitchCase": 1 }],

lib/protocol/Auth.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Auth.hashPassword = function(password) {
5353

5454
// nr^= (((nr & 63)+add)*c)+ (nr << 8);
5555
// nr = xor(nr, add(mul(add(and(nr, 63), add), c), shl(nr, 8)))
56-
nr = this.xor32(nr, this.add32(this.mul32(this.add32(this.and32(nr, [0,63]), [0,add]), [0,c]), this.shl32(nr, 8)));
56+
nr = this.xor32(nr, this.add32(this.mul32(this.add32(this.and32(nr, [0, 63]), [0, add]), [0, c]), this.shl32(nr, 8)));
5757

5858
// nr2+=(nr2 << 8) ^ nr;
5959
// nr2 = add(nr2, xor(shl(nr2, 8), nr))
@@ -105,18 +105,18 @@ Auth.scramble323 = function(message, password) {
105105
return to;
106106
};
107107

108-
Auth.xor32 = function(a,b){
108+
Auth.xor32 = function(a, b){
109109
return [a[0] ^ b[0], a[1] ^ b[1]];
110110
};
111111

112-
Auth.add32 = function(a,b){
112+
Auth.add32 = function(a, b){
113113
var w1 = a[1] + b[1],
114114
w2 = a[0] + b[0] + ((w1 & 0xFFFF0000) >> 16);
115115

116116
return [w2 & 0xFFFF, w1 & 0xFFFF];
117117
};
118118

119-
Auth.mul32 = function(a,b){
119+
Auth.mul32 = function(a, b){
120120
// based on this example of multiplying 32b ints using 16b
121121
// http://www.dsprelated.com/showmessage/89790/1.php
122122
var w1 = a[1] * b[1],
@@ -125,11 +125,11 @@ Auth.mul32 = function(a,b){
125125
return [w2 & 0xFFFF, w1 & 0xFFFF];
126126
};
127127

128-
Auth.and32 = function(a,b){
128+
Auth.and32 = function(a, b){
129129
return [a[0] & b[0], a[1] & b[1]];
130130
};
131131

132-
Auth.shl32 = function(a,b){
132+
Auth.shl32 = function(a, b){
133133
// assume b is 16 or less
134134
var w1 = a[1] << b,
135135
w2 = (a[0] << b) | ((w1 & 0xFFFF0000) >> 16);

lib/protocol/sequences/Query.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,21 +197,21 @@ Query.prototype.stream = function(options) {
197197
});
198198
});
199199

200-
this.on('result',function(row,i) {
200+
this.on('result', function(row, i) {
201201
if (!stream.push(row)) self._connection.pause();
202-
stream.emit('result',row,i); // replicate old emitter
202+
stream.emit('result', row, i); // replicate old emitter
203203
});
204204

205-
this.on('error',function(err) {
206-
stream.emit('error',err); // Pass on any errors
205+
this.on('error', function(err) {
206+
stream.emit('error', err); // Pass on any errors
207207
});
208208

209209
this.on('end', function() {
210210
stream.push(null); // pushing null, indicating EOF
211211
});
212212

213-
this.on('fields',function(fields,i) {
214-
stream.emit('fields',fields,i); // replicate old emitter
213+
this.on('fields', function(fields, i) {
214+
stream.emit('fields', fields, i); // replicate old emitter
215215
});
216216

217217
return stream;

test/integration/connection/test-type-casting.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ var tests = [
4141
{type: 'point', insertRaw: 'POINT(1.2,-3.4)', expect: {x: 1.2, y: -3.4}, deep: true},
4242
{type: 'point', insertRaw: '', insert: null, expect: null},
4343
{type: 'linestring', insertRaw: 'LINESTRING(POINT(1.2,-3.4),POINT(-5.6,10.23),POINT(0.2,0.7))', expect: [{x: 1.2, y: -3.4}, {x: -5.6, y: 10.23}, {x: 0.2, y: 0.7}], deep: true},
44-
{type: 'polygon', insertRaw: 'POLYGON(LINESTRING(POINT(0,0),POINT(10,0),POINT(10,10),POINT(0,10),POINT(0,0)),LINESTRING(POINT(5,5),POINT(7,5),POINT(7,7),POINT(5,7),POINT(5,5)))', expect: [[{x: 0,y: 0}, {x: 10, y: 0}, {x: 10, y: 10}, {x: 0, y: 10}, {x: 0, y: 0}], [{x: 5, y: 5}, {x: 7, y: 5}, {x: 7, y: 7}, {x: 5, y: 7}, {x: 5, y: 5}]], deep: true},
44+
{type: 'polygon', insertRaw: 'POLYGON(LINESTRING(POINT(0,0),POINT(10,0),POINT(10,10),POINT(0,10),POINT(0,0)),LINESTRING(POINT(5,5),POINT(7,5),POINT(7,7),POINT(5,7),POINT(5,5)))', expect: [[{x: 0, y: 0}, {x: 10, y: 0}, {x: 10, y: 10}, {x: 0, y: 10}, {x: 0, y: 0}], [{x: 5, y: 5}, {x: 7, y: 5}, {x: 7, y: 7}, {x: 5, y: 7}, {x: 5, y: 5}]], deep: true},
4545
{type: 'geometry', insertRaw: 'POINT(1.2,-3.4)', expect: {x: 1.2, y: -3.4}, deep: true},
4646
{type: 'multipoint', insertRaw: 'MULTIPOINT(POINT(0,0),POINT(20,20),POINT(60,60))', expect: [{x: 0, y: 0}, {x: 20, y: 20}, {x: 60, y: 60}], deep: true},
4747
{type: 'multilinestring', insertRaw: 'MULTILINESTRING(LINESTRING(POINT(10,10),POINT(20,20)),LINESTRING(POINT(15,15),POINT(30,15)))', expect: [[{x: 10, y: 10}, {x: 20, y: 20}], [{x: 15, y: 15}, {x: 30, y: 15}]], deep: true},
48-
{type: 'multipolygon', insertRaw: 'MULTIPOLYGON(POLYGON(LINESTRING(POINT(0,0),POINT(10,0),POINT(10,10),POINT(0,10),POINT(0,0))),POLYGON(LINESTRING(POINT(5,5),POINT(7,5),POINT(7,7),POINT(5,7),POINT(5,5))))', expect: [[[{x: 0,y: 0}, {x: 10, y: 0}, {x: 10, y: 10}, {x: 0, y: 10}, {x: 0, y: 0}]], [[{x: 5, y: 5}, {x: 7, y: 5}, {x: 7, y: 7}, {x: 5, y: 7}, {x: 5, y: 5}]]], deep: true},
49-
{type: 'geometrycollection', insertRaw: 'GEOMETRYCOLLECTION(POINT(10,10),POINT(30,30),LINESTRING(POINT(15,15),POINT(20,20)))', expect: [{x: 10, y: 10}, {x: 30, y: 30}, [{x: 15, y: 15}, {x: 20,y: 20}]], deep: true}
48+
{type: 'multipolygon', insertRaw: 'MULTIPOLYGON(POLYGON(LINESTRING(POINT(0,0),POINT(10,0),POINT(10,10),POINT(0,10),POINT(0,0))),POLYGON(LINESTRING(POINT(5,5),POINT(7,5),POINT(7,7),POINT(5,7),POINT(5,5))))', expect: [[[{x: 0, y: 0}, {x: 10, y: 0}, {x: 10, y: 10}, {x: 0, y: 10}, {x: 0, y: 0}]], [[{x: 5, y: 5}, {x: 7, y: 5}, {x: 7, y: 7}, {x: 5, y: 7}, {x: 5, y: 5}]]], deep: true},
49+
{type: 'geometrycollection', insertRaw: 'GEOMETRYCOLLECTION(POINT(10,10),POINT(30,30),LINESTRING(POINT(15,15),POINT(20,20)))', expect: [{x: 10, y: 10}, {x: 30, y: 30}, [{x: 15, y: 15}, {x: 20, y: 20}]], deep: true}
5050
];
5151

5252
var table = 'type_casting';

test/unit/pool-cluster/test-pattern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var server = common.createFakeServer();
55

66
var poolConfig = common.getTestConfig({port: common.fakeServerPort});
77
cluster.add('MASTER', poolConfig);
8-
cluster.add('SLAVE' , poolConfig);
8+
cluster.add('SLAVE', poolConfig);
99
cluster.add('SLAVE1', poolConfig);
1010
cluster.add('SLAVE2', poolConfig);
1111

test/unit/protocol/test-SqlString.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ test('SqlString.escape', {
6464
},
6565

6666
'nested arrays are turned into grouped lists': function() {
67-
assert.equal(SqlString.escape([[1,2,3], [4,5,6], ['a', 'b', {nested: true}]]), "(1, 2, 3), (4, 5, 6), ('a', 'b', '[object Object]')");
67+
assert.equal(SqlString.escape([[1, 2, 3], [4, 5, 6], ['a', 'b', {nested: true}]]), "(1, 2, 3), (4, 5, 6), ('a', 'b', '[object Object]')");
6868
},
6969

7070
'nested objects inside arrays are cast to strings': function() {

0 commit comments

Comments
 (0)