MCPcopy Create free account
hub / github.com/wevm/viem / isLocalNetwork

Function isLocalNetwork

test/scripts/chains.test.ts:119–124  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

117})
118
119function isLocalNetwork(url: string): boolean {
120 const { hostname } = new URL(url)
121 const localNetworkRegex =
122 /^(127\.|10\.|172\.1[6-9]\.|172\.2[0-9]\.|172\.3[0-1]\.|192\.168\.)/
123 return localNetworkRegex.test(hostname) || hostname === 'localhost'
124}

Callers 1

chains.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected