@@ -57,7 +57,7 @@ export class BsonDecoder implements BinaryJsonDecoder {
5757 public readCString ( ) : string {
5858 const reader = this . reader ;
5959 const uint8 = reader . uint8 ;
60- let x = reader . x ;
60+ const x = reader . x ;
6161 let length = 0 ;
6262
6363 // Find the null terminator
@@ -169,8 +169,8 @@ export class BsonDecoder implements BinaryJsonDecoder {
169169
170170 public readArray ( ) : unknown [ ] {
171171 const doc = this . readDocument ( ) as Record < string , unknown > ;
172- const keys = Object . keys ( doc ) . sort ( ( a , b ) => parseInt ( a ) - parseInt ( b ) ) ;
173- return keys . map ( key => doc [ key ] ) ;
172+ const keys = Object . keys ( doc ) . sort ( ( a , b ) => parseInt ( a , 10 ) - parseInt ( b , 10 ) ) ;
173+ return keys . map ( ( key ) => doc [ key ] ) ;
174174 }
175175
176176 public readBinary ( ) : BsonBinary | Uint8Array {
@@ -195,13 +195,13 @@ export class BsonDecoder implements BinaryJsonDecoder {
195195
196196 // Timestamp (4 bytes, big-endian)
197197 const timestamp = ( uint8 [ x ] << 24 ) | ( uint8 [ x + 1 ] << 16 ) | ( uint8 [ x + 2 ] << 8 ) | uint8 [ x + 3 ] ;
198-
198+
199199 // Process ID (5 bytes) - first 4 bytes are little-endian, then 1 high byte
200200 const processLo = uint8 [ x + 4 ] | ( uint8 [ x + 5 ] << 8 ) | ( uint8 [ x + 6 ] << 16 ) | ( uint8 [ x + 7 ] << 24 ) ;
201201 const processHi = uint8 [ x + 8 ] ;
202202 // Convert to unsigned 32-bit first, then combine with high byte
203203 const processLoUnsigned = processLo >>> 0 ; // Convert to unsigned
204- const process = processLoUnsigned + ( processHi * 0x100000000 ) ;
204+ const process = processLoUnsigned + processHi * 0x100000000 ;
205205
206206 // Counter (3 bytes, big-endian)
207207 const counter = ( uint8 [ x + 9 ] << 16 ) | ( uint8 [ x + 10 ] << 8 ) | uint8 [ x + 11 ] ;
@@ -245,4 +245,4 @@ export class BsonDecoder implements BinaryJsonDecoder {
245245 const data = reader . buf ( 16 ) ;
246246 return new BsonDecimal128 ( data ) ;
247247 }
248- }
248+ }
0 commit comments