File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ type MakeClientMetadataOptions = Pick<MongoOptions, 'appName'>;
117
117
* 4. Truncate `platform`. -- special we do not truncate this field
118
118
*/
119
119
export function makeClientMetadata (
120
- driverInfos : DriverInfo [ ] ,
120
+ driverInfoList : DriverInfo [ ] ,
121
121
{ appName = '' } : MakeClientMetadataOptions
122
122
) : ClientMetadata {
123
123
const metadataDocument = new LimitedSizeDocument ( 512 ) ;
@@ -137,7 +137,7 @@ export function makeClientMetadata(
137
137
} ;
138
138
139
139
// This is where we handle additional driver info added after client construction.
140
- for ( const { name : n = '' , version : v = '' } of driverInfos ) {
140
+ for ( const { name : n = '' , version : v = '' } of driverInfoList ) {
141
141
if ( n . length > 0 ) {
142
142
driverInfo . name = `${ driverInfo . name } |${ n } ` ;
143
143
}
@@ -154,7 +154,7 @@ export function makeClientMetadata(
154
154
155
155
let runtimeInfo = getRuntimeInfo ( ) ;
156
156
// This is where we handle additional driver info added after client construction.
157
- for ( const { platform = '' } of driverInfos ) {
157
+ for ( const { platform = '' } of driverInfoList ) {
158
158
if ( platform . length > 0 ) {
159
159
runtimeInfo = `${ runtimeInfo } |${ platform } ` ;
160
160
}
Original file line number Diff line number Diff line change @@ -431,7 +431,7 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> implements
431
431
| 'extendedMetadata'
432
432
> ;
433
433
434
- private driverInfos : DriverInfo [ ] = [ ] ;
434
+ private driverInfoList : DriverInfo [ ] = [ ] ;
435
435
436
436
constructor ( url : string , options ?: MongoClientOptions ) {
437
437
super ( ) ;
@@ -497,13 +497,13 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> implements
497
497
* @param driverInfo - Information about the application or library.
498
498
*/
499
499
appendMetadata ( driverInfo : DriverInfo ) {
500
- const isDuplicateDriverInfo = this . driverInfos . some ( info =>
500
+ const isDuplicateDriverInfo = this . driverInfoList . some ( info =>
501
501
isDriverInfoEqual ( info , driverInfo )
502
502
) ;
503
503
if ( isDuplicateDriverInfo ) return ;
504
504
505
- this . driverInfos . push ( driverInfo ) ;
506
- this . options . metadata = makeClientMetadata ( this . driverInfos , this . options ) ;
505
+ this . driverInfoList . push ( driverInfo ) ;
506
+ this . options . metadata = makeClientMetadata ( this . driverInfoList , this . options ) ;
507
507
this . options . extendedMetadata = addContainerMetadata ( this . options . metadata )
508
508
. then ( undefined , squashError )
509
509
. then ( result => result ?? { } ) ; // ensure Promise<Document>
You can’t perform that action at this time.
0 commit comments