MCPcopy
hub / github.com/mongodb/node-mongodb-native / fromHostPort

Method fromHostPort

src/utils.ts:949–954  ·  view source on GitHub ↗
(host: string, port: number)

Source from the content-addressed store, hash-verified

947 }
948
949 static fromHostPort(host: string, port: number): HostAddress {
950 if (host.includes(':')) {
951 host = `[${host}]`; // IPv6 address
952 }
953 return HostAddress.fromString(`${host}:${port}`);
954 }
955
956 static fromSrvRecord({ name, port }: SrvRecord): HostAddress {
957 return HostAddress.fromHostPort(name, port);

Callers 3

fromSrvRecordMethod · 0.80
makeSocks5ConnectionFunction · 0.80
streamIdentifierFunction · 0.80

Calls 1

fromStringMethod · 0.45

Tested by

no test coverage detected