* Append metadata to the client metadata after instantiation. * @param driverInfo - Information about the application or library.
(driverInfo: DriverInfo)
| 493 | * @param driverInfo - Information about the application or library. |
| 494 | */ |
| 495 | appendMetadata(driverInfo: DriverInfo) { |
| 496 | const isDuplicateDriverInfo = this.driverInfoList.some(info => |
| 497 | isDriverInfoEqual(info, driverInfo) |
| 498 | ); |
| 499 | if (isDuplicateDriverInfo) return; |
| 500 | |
| 501 | this.driverInfoList.push(driverInfo); |
| 502 | this.options.metadata = makeClientMetadata(this.driverInfoList, this.options) |
| 503 | .then(undefined, squashError) |
| 504 | .then(result => result ?? ({} as ClientMetadata)); // ensure Promise<Document> |
| 505 | } |
| 506 | |
| 507 | /** @internal */ |
| 508 | private checkForNonGenuineHosts() { |
no test coverage detected