(origin, addresses)
| 11990 | } |
| 11991 | this.setRecords(origin, addresses); |
| 11992 | const records = __privateGet(this, _records).get(origin.hostname); |
| 11993 | const ip = this.pick( |
| 11994 | origin, |
| 11995 | records, |
| 11996 | newOpts.affinity |
| 11997 | ); |
| 11998 | let port; |
| 11999 | if (typeof ip.port === "number") { |
| 12000 | port = `:${ip.port}`; |
| 12001 | } else if (origin.port !== "") { |
| 12002 | port = `:${origin.port}`; |
| 12003 | } else { |
| 12004 | port = ""; |
| 12005 | } |
| 12006 | cb( |
| 12007 | null, |
| 12008 | `${origin.protocol}//${ip.family === 6 ? `[${ip.address}]` : ip.address}${port}` |
| 12009 | ); |
| 12010 | }); |
| 12011 | } else { |
no test coverage detected