@@ -299,19 +299,11 @@ class Connection extends EventEmitter {
299
299
if ( this . config . debug ) {
300
300
// eslint-disable-next-line no-console
301
301
console . log (
302
- `${ this . _internalId } ${ this . connectionId } <== ${
303
- this . _command . _commandName
304
- } #${ this . _command . stateName ( ) } (${ [
305
- this . sequenceId ,
306
- packet . _name ,
307
- packet . length ( )
308
- ] . join ( ',' ) } )`
302
+ `${ this . _internalId } ${ this . connectionId } <== ${ this . _command . _commandName } #${ this . _command . stateName ( ) } (${ [ this . sequenceId , packet . _name , packet . length ( ) ] . join ( ',' ) } )`
309
303
) ;
310
304
// eslint-disable-next-line no-console
311
305
console . log (
312
- `${ this . _internalId } ${
313
- this . connectionId
314
- } <== ${ packet . buffer . toString ( 'hex' ) } `
306
+ `${ this . _internalId } ${ this . connectionId } <== ${ packet . buffer . toString ( 'hex' ) } `
315
307
) ;
316
308
}
317
309
this . _bumpSequenceId ( 1 ) ;
@@ -320,19 +312,11 @@ class Connection extends EventEmitter {
320
312
if ( this . config . debug ) {
321
313
// eslint-disable-next-line no-console
322
314
console . log (
323
- `${ this . _internalId } ${
324
- this . connectionId
325
- } <== Writing large packet, raw content not written:`
315
+ `${ this . _internalId } ${ this . connectionId } <== Writing large packet, raw content not written:`
326
316
) ;
327
317
// eslint-disable-next-line no-console
328
318
console . log (
329
- `${ this . _internalId } ${ this . connectionId } <== ${
330
- this . _command . _commandName
331
- } #${ this . _command . stateName ( ) } (${ [
332
- this . sequenceId ,
333
- packet . _name ,
334
- packet . length ( )
335
- ] . join ( ',' ) } )`
319
+ `${ this . _internalId } ${ this . connectionId } <== ${ this . _command . _commandName } #${ this . _command . stateName ( ) } (${ [ this . sequenceId , packet . _name , packet . length ( ) ] . join ( ',' ) } )`
336
320
) ;
337
321
}
338
322
for ( offset = 4 ; offset < 4 + length ; offset += MAX_PACKET_LENGTH ) {
@@ -441,9 +425,7 @@ class Connection extends EventEmitter {
441
425
if ( packet ) {
442
426
// eslint-disable-next-line no-console
443
427
console . log (
444
- ` raw: ${ packet . buffer
445
- . slice ( packet . offset , packet . offset + packet . length ( ) )
446
- . toString ( 'hex' ) } `
428
+ ` raw: ${ packet . buffer . slice ( packet . offset , packet . offset + packet . length ( ) ) . toString ( 'hex' ) } `
447
429
) ;
448
430
// eslint-disable-next-line no-console
449
431
console . trace ( ) ;
@@ -455,13 +437,7 @@ class Connection extends EventEmitter {
455
437
: '(no command)' ;
456
438
// eslint-disable-next-line no-console
457
439
console . log (
458
- `${ this . _internalId } ${
459
- this . connectionId
460
- } ==> ${ commandName } #${ stateName } (${ [
461
- packet . sequenceId ,
462
- packet . type ( ) ,
463
- packet . length ( )
464
- ] . join ( ',' ) } )`
440
+ `${ this . _internalId } ${ this . connectionId } ==> ${ commandName } #${ stateName } (${ [ packet . sequenceId , packet . type ( ) , packet . length ( ) ] . join ( ',' ) } )`
465
441
) ;
466
442
}
467
443
}
@@ -597,9 +573,7 @@ class Connection extends EventEmitter {
597
573
cmdQuery . values !== undefined ? cmdQuery . values : [ ]
598
574
) ;
599
575
cmdQuery . sql = rawSql ;
600
- // eslint-disable-next-line consistent-this, no-invalid-this
601
- const self = this ;
602
- cmdQuery . once ( 'end' , ( ) => self . emit ( 'done' ) ) ;
576
+ cmdQuery . once ( 'end' , ( ) => this . emit ( 'done' ) ) ;
603
577
return this . addCommand ( cmdQuery ) ;
604
578
}
605
579
@@ -720,9 +694,7 @@ class Connection extends EventEmitter {
720
694
} ) ;
721
695
this . addCommand ( prepareCommand ) ;
722
696
this . addCommand ( executeCommand ) ;
723
- // eslint-disable-next-line consistent-this, no-invalid-this
724
- const self = this ;
725
- executeCommand . once ( 'end' , ( ) => self . emit ( 'done' ) ) ;
697
+ executeCommand . once ( 'end' , ( ) => this . emit ( 'done' ) ) ;
726
698
return executeCommand ;
727
699
}
728
700
@@ -970,9 +942,7 @@ class Connection extends EventEmitter {
970
942
}
971
943
972
944
static statementKey ( options ) {
973
- return `${ typeof options . nestTables } /${ options . nestTables } /${
974
- options . rowsAsArray
975
- } ${ options . sql } `;
945
+ return `${ typeof options . nestTables } /${ options . nestTables } /${ options . rowsAsArray } ${ options . sql } ` ;
976
946
}
977
947
}
978
948
0 commit comments