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

Function isAddressLiteral

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 2

parseIpv4Function · 0.85
replaceMethod · 0.65

Tested by

no test coverage detected