(error: unknown, codeName: string)
| 393 | const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); |
| 394 | |
| 395 | function isMongoError(error: unknown, codeName: string) { |
| 396 | return ( |
| 397 | typeof error === "object" && |
| 398 | error !== null && |
| 399 | "codeName" in error && |
| 400 | error.codeName === codeName |
| 401 | ); |
| 402 | } |
| 403 | |
| 404 | async function ensureMongoPrimary(mongodb: MongoClient) { |
| 405 | const admin = mongodb.db("admin"); |
no outgoing calls
no test coverage detected