MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / isAddressLiteral

Function isAddressLiteral

packages/core/sdk/src/hosted-http-client.ts:125–128  ·  view source on GitHub ↗
(hostname: string)

Source from the content-addressed store, hash-verified

123};
124
125const isAddressLiteral = (hostname: string): boolean => {
126 const normalized = hostname.toLowerCase().replace(/^\[|\]$/g, "");
127 return parseIpv4(normalized) !== null || /^[0-9a-f:.]+$/i.test(normalized);
128};
129
130const resolveHostnameWithNodeDns: HostedHostnameResolver = async (hostname) => {
131 const { lookup } = await import("node:dns/promises");

Callers 1

Calls 2

parseIpv4Function · 0.85
replaceMethod · 0.65

Tested by

no test coverage detected