Skip to content

Commit 4ae8768

Browse files
committed
fix lint issue
1 parent 5e5e959 commit 4ae8768

File tree

4 files changed

+24
-31
lines changed

4 files changed

+24
-31
lines changed

.eslintrc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@
99
"es6": true
1010
},
1111
"rules": {
12-
"@typescript-eslint/typedef": [
13-
"error",
14-
{
15-
"arrowParameter": true,
16-
"variableDeclaration": true
17-
}
18-
],
1912
"template-curly-spacing": ["error", "never"],
2013
"prefer-template": "error",
2114
"no-useless-call": "error",

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export interface Connection extends mysql.Connection {
8383
sequenceId: number;
8484
}
8585

86-
export interface PoolConnection extends Connection {
86+
export interface PoolConnection extends mysql.PoolConnection, Connection {
8787
promise(promiseImpl?: PromiseConstructor): PromisePoolConnection;
8888
}
8989

lib/commands/server_handshake.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ServerHandshake extends Command {
7171

7272
_isStatement(query, name) {
7373
const firstWord = query.split(' ')[0].toUpperCase();
74-
return firstWord == name;
74+
return firstWord === name;
7575
}
7676

7777
dispatchCommands(packet, connection) {

lib/packets/execute.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -89,54 +89,54 @@ class Execute {
8989
let nullBitmaps = 0;
9090
let i = packet.offset;
9191
while (i < packet.end - 1) {
92-
if((packet.buffer[i+1] == Types.VAR_STRING
93-
|| packet.buffer[i+1] == Types.NULL
94-
|| packet.buffer[i+1] == Types.DOUBLE
95-
|| packet.buffer[i+1] == Types.TINY
96-
|| packet.buffer[i+1] == Types.DATETIME
97-
|| packet.buffer[i+1] == Types.JSON) && packet.buffer[i] == 1 && packet.buffer[i+2] == 0) {
98-
break
92+
if((packet.buffer[i+1] === Types.VAR_STRING
93+
|| packet.buffer[i+1] === Types.NULL
94+
|| packet.buffer[i+1] === Types.DOUBLE
95+
|| packet.buffer[i+1] === Types.TINY
96+
|| packet.buffer[i+1] === Types.DATETIME
97+
|| packet.buffer[i+1] === Types.JSON) && packet.buffer[i] === 1 && packet.buffer[i+2] === 0) {
98+
break;
9999
}
100100
else {
101-
nullBitmaps += packet.readInt8();
101+
packet.readInt8()
102102
}
103103
i++;
104104
}
105105

106106
const types = [];
107107

108108
for(let i = packet.offset + 1; i < packet.end - 1; i++) {
109-
if((packet.buffer[i] == Types.VAR_STRING
110-
|| packet.buffer[i] == Types.NULL
111-
|| packet.buffer[i] == Types.DOUBLE
112-
|| packet.buffer[i] == Types.TINY
113-
|| packet.buffer[i] == Types.DATETIME
114-
|| packet.buffer[i] == Types.JSON) && packet.buffer[i + 1] == 0) {
115-
types.push(packet.buffer[i]);
116-
packet.skip(2);
109+
if((packet.buffer[i] === Types.VAR_STRING
110+
|| packet.buffer[i] === Types.NULL
111+
|| packet.buffer[i] === Types.DOUBLE
112+
|| packet.buffer[i] === Types.TINY
113+
|| packet.buffer[i] === Types.DATETIME
114+
|| packet.buffer[i] === Types.JSON) && packet.buffer[i + 1] === 0) {
115+
types.push(packet.buffer[i]);
116+
packet.skip(2);
117117
}
118118
}
119119

120120
packet.skip(1);
121121

122122
const values = [];
123123
for(let i = 0; i < types.length; i++) {
124-
if(types[i] == Types.VAR_STRING) {
124+
if(types[i] === Types.VAR_STRING) {
125125
values.push(packet.readLengthCodedString(encoding))
126126
}
127-
else if(types[i] == Types.DOUBLE) {
127+
else if(types[i] === Types.DOUBLE) {
128128
values.push(packet.readDouble())
129129
}
130-
else if(types[i] == Types.TINY) {
130+
else if(types[i] === Types.TINY) {
131131
values.push(packet.readInt8())
132132
}
133-
else if(types[i] == Types.DATETIME) {
133+
else if(types[i] === Types.DATETIME) {
134134
values.push(packet.readDateTime())
135135
}
136-
else if(types[i] == Types.JSON) {
136+
else if(types[i] === Types.JSON) {
137137
values.push(JSON.parse(packet.readLengthCodedString(encoding)))
138138
}
139-
if(types[i] == Types.NULL) {
139+
if(types[i] === Types.NULL) {
140140
values.push(null)
141141
}
142142
}

0 commit comments

Comments
 (0)