Skip to content

Commit 6632130

Browse files
rename driverInfos
1 parent 351d399 commit 6632130

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/cmap/handshake/client_metadata.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ type MakeClientMetadataOptions = Pick<MongoOptions, 'appName'>;
117117
* 4. Truncate `platform`. -- special we do not truncate this field
118118
*/
119119
export function makeClientMetadata(
120-
driverInfos: DriverInfo[],
120+
driverInfoList: DriverInfo[],
121121
{ appName = '' }: MakeClientMetadataOptions
122122
): ClientMetadata {
123123
const metadataDocument = new LimitedSizeDocument(512);
@@ -137,7 +137,7 @@ export function makeClientMetadata(
137137
};
138138

139139
// 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) {
141141
if (n.length > 0) {
142142
driverInfo.name = `${driverInfo.name}|${n}`;
143143
}
@@ -154,7 +154,7 @@ export function makeClientMetadata(
154154

155155
let runtimeInfo = getRuntimeInfo();
156156
// This is where we handle additional driver info added after client construction.
157-
for (const { platform = '' } of driverInfos) {
157+
for (const { platform = '' } of driverInfoList) {
158158
if (platform.length > 0) {
159159
runtimeInfo = `${runtimeInfo}|${platform}`;
160160
}

src/mongo_client.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> implements
431431
| 'extendedMetadata'
432432
>;
433433

434-
private driverInfos: DriverInfo[] = [];
434+
private driverInfoList: DriverInfo[] = [];
435435

436436
constructor(url: string, options?: MongoClientOptions) {
437437
super();
@@ -497,13 +497,13 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> implements
497497
* @param driverInfo - Information about the application or library.
498498
*/
499499
appendMetadata(driverInfo: DriverInfo) {
500-
const isDuplicateDriverInfo = this.driverInfos.some(info =>
500+
const isDuplicateDriverInfo = this.driverInfoList.some(info =>
501501
isDriverInfoEqual(info, driverInfo)
502502
);
503503
if (isDuplicateDriverInfo) return;
504504

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);
507507
this.options.extendedMetadata = addContainerMetadata(this.options.metadata)
508508
.then(undefined, squashError)
509509
.then(result => result ?? {}); // ensure Promise<Document>

0 commit comments

Comments
 (0)