@internal
()
| 506 | |
| 507 | /** @internal */ |
| 508 | private checkForNonGenuineHosts() { |
| 509 | const documentDBHostnames = this.options.hosts.filter((hostAddress: HostAddress) => |
| 510 | isHostMatch(DOCUMENT_DB_CHECK, hostAddress.host) |
| 511 | ); |
| 512 | const srvHostIsDocumentDB = isHostMatch(DOCUMENT_DB_CHECK, this.options.srvHost); |
| 513 | |
| 514 | const cosmosDBHostnames = this.options.hosts.filter((hostAddress: HostAddress) => |
| 515 | isHostMatch(COSMOS_DB_CHECK, hostAddress.host) |
| 516 | ); |
| 517 | const srvHostIsCosmosDB = isHostMatch(COSMOS_DB_CHECK, this.options.srvHost); |
| 518 | |
| 519 | if (documentDBHostnames.length !== 0 || srvHostIsDocumentDB) { |
| 520 | this.mongoLogger?.info('client', DOCUMENT_DB_MSG); |
| 521 | } else if (cosmosDBHostnames.length !== 0 || srvHostIsCosmosDB) { |
| 522 | this.mongoLogger?.info('client', COSMOS_DB_MSG); |
| 523 | } |
| 524 | } |
| 525 | |
| 526 | get serverApi(): Readonly<ServerApi | undefined> { |
| 527 | return this.options.serverApi && Object.freeze({ ...this.options.serverApi }); |
no test coverage detected