(host)
| 11 | const IPV4_LOOPBACK_RE = /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/; |
| 12 | |
| 13 | export function isLoopbackBind(host) { |
| 14 | if (host == null || host === "") return false; |
| 15 | const normalized = String(host) |
| 16 | .trim() |
| 17 | .replace(/^\[|\]$/g, "") |
| 18 | .toLowerCase(); |
| 19 | return STATIC_LOOPBACK_HOSTS.has(normalized) || IPV4_LOOPBACK_RE.test(normalized); |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * Resolve the listen address. |
no outgoing calls
no test coverage detected