@@ -50,22 +50,18 @@ class ColumnDef {
50
50
switch ( this . columnType ) {
51
51
case FieldType . TINY :
52
52
if ( this . signed ( ) ) {
53
- this . _read = ( packet , index , nullBitmap ) =>
54
- isNullBitmap ( index , nullBitmap ) ? null : packet . readInt8 ( ) ;
53
+ this . _read = ( packet , index , nullBitmap ) => ( isNullBitmap ( index , nullBitmap ) ? null : packet . readInt8 ( ) ) ;
55
54
} else {
56
- this . _read = ( packet , index , nullBitmap ) =>
57
- isNullBitmap ( index , nullBitmap ) ? null : packet . readUInt8 ( ) ;
55
+ this . _read = ( packet , index , nullBitmap ) => ( isNullBitmap ( index , nullBitmap ) ? null : packet . readUInt8 ( ) ) ;
58
56
}
59
57
break ;
60
58
61
59
case FieldType . YEAR :
62
60
case FieldType . SHORT :
63
61
if ( this . signed ( ) ) {
64
- this . _read = ( packet , index , nullBitmap ) =>
65
- isNullBitmap ( index , nullBitmap ) ? null : packet . readInt16 ( ) ;
62
+ this . _read = ( packet , index , nullBitmap ) => ( isNullBitmap ( index , nullBitmap ) ? null : packet . readInt16 ( ) ) ;
66
63
} else {
67
- this . _read = ( packet , index , nullBitmap ) =>
68
- isNullBitmap ( index , nullBitmap ) ? null : packet . readUInt16 ( ) ;
64
+ this . _read = ( packet , index , nullBitmap ) => ( isNullBitmap ( index , nullBitmap ) ? null : packet . readUInt16 ( ) ) ;
69
65
}
70
66
break ;
71
67
@@ -93,33 +89,26 @@ class ColumnDef {
93
89
94
90
case FieldType . INT :
95
91
if ( this . signed ( ) ) {
96
- this . _read = ( packet , index , nullBitmap ) =>
97
- isNullBitmap ( index , nullBitmap ) ? null : packet . readInt32 ( ) ;
92
+ this . _read = ( packet , index , nullBitmap ) => ( isNullBitmap ( index , nullBitmap ) ? null : packet . readInt32 ( ) ) ;
98
93
} else {
99
- this . _read = ( packet , index , nullBitmap ) =>
100
- isNullBitmap ( index , nullBitmap ) ? null : packet . readUInt32 ( ) ;
94
+ this . _read = ( packet , index , nullBitmap ) => ( isNullBitmap ( index , nullBitmap ) ? null : packet . readUInt32 ( ) ) ;
101
95
}
102
96
break ;
103
97
104
98
case FieldType . FLOAT :
105
- this . _read = ( packet , index , nullBitmap ) =>
106
- isNullBitmap ( index , nullBitmap ) ? null : packet . readFloat ( ) ;
99
+ this . _read = ( packet , index , nullBitmap ) => ( isNullBitmap ( index , nullBitmap ) ? null : packet . readFloat ( ) ) ;
107
100
break ;
108
101
109
102
case FieldType . DOUBLE :
110
- this . _read = ( packet , index , nullBitmap ) =>
111
- isNullBitmap ( index , nullBitmap ) ? null : packet . readDouble ( ) ;
103
+ this . _read = ( packet , index , nullBitmap ) => ( isNullBitmap ( index , nullBitmap ) ? null : packet . readDouble ( ) ) ;
112
104
break ;
113
105
114
106
case FieldType . BIGINT :
115
107
this . _read = ( packet , index , nullBitmap , opts ) => {
116
108
if ( isNullBitmap ( index , nullBitmap ) ) return null ;
117
109
const val = this . signed ( ) ? packet . readBigInt64 ( ) : packet . readBigUInt64 ( ) ;
118
110
if ( val != null && ( opts . bigIntAsNumber || opts . supportBigNumbers ) ) {
119
- if (
120
- opts . supportBigNumbers &&
121
- ( opts . bigNumberStrings || ! Number . isSafeInteger ( Number ( val ) ) )
122
- ) {
111
+ if ( opts . supportBigNumbers && ( opts . bigNumberStrings || ! Number . isSafeInteger ( Number ( val ) ) ) ) {
123
112
return val . toString ( ) ;
124
113
}
125
114
return Number ( val ) ;
@@ -134,10 +123,7 @@ class ColumnDef {
134
123
if ( isNullBitmap ( index , nullBitmap ) ) return null ;
135
124
const valDec = packet . readDecimalLengthEncoded ( ) ;
136
125
if ( valDec != null && ( opts . decimalAsNumber || opts . supportBigNumbers ) ) {
137
- if (
138
- opts . supportBigNumbers &&
139
- ( opts . bigNumberStrings || ! Number . isSafeInteger ( Number ( valDec ) ) )
140
- ) {
126
+ if ( opts . supportBigNumbers && ( opts . bigNumberStrings || ! Number . isSafeInteger ( Number ( valDec ) ) ) ) {
141
127
return valDec . toString ( ) ;
142
128
}
143
129
return Number ( valDec ) ;
@@ -239,10 +225,7 @@ class ColumnDef {
239
225
this . _read = ( packet , index , nullBitmap , opts ) => {
240
226
const val = packet . readBigIntLengthEncoded ( ) ;
241
227
if ( val != null && ( opts . bigIntAsNumber || opts . supportBigNumbers ) ) {
242
- if (
243
- opts . supportBigNumbers &&
244
- ( opts . bigNumberStrings || ! Number . isSafeInteger ( Number ( val ) ) )
245
- ) {
228
+ if ( opts . supportBigNumbers && ( opts . bigNumberStrings || ! Number . isSafeInteger ( Number ( val ) ) ) ) {
246
229
return val . toString ( ) ;
247
230
}
248
231
return Number ( val ) ;
@@ -256,10 +239,7 @@ class ColumnDef {
256
239
this . _read = ( packet , index , nullBitmap , opts ) => {
257
240
const valDec = packet . readDecimalLengthEncoded ( ) ;
258
241
if ( valDec != null && ( opts . decimalAsNumber || opts . supportBigNumbers ) ) {
259
- if (
260
- opts . supportBigNumbers &&
261
- ( opts . bigNumberStrings || ! Number . isSafeInteger ( Number ( valDec ) ) )
262
- ) {
242
+ if ( opts . supportBigNumbers && ( opts . bigNumberStrings || ! Number . isSafeInteger ( Number ( valDec ) ) ) ) {
263
243
return valDec . toString ( ) ;
264
244
}
265
245
return Number ( valDec ) ;
0 commit comments