* https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml * https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml * https://www.iana.org/assignments/special-use-domain-names/special-use-domain-names.xhtml * @param {string
(host)
| 88 | * @returns {boolean} |
| 89 | */ |
| 90 | function isLoopback(host) { |
| 91 | const hostLower = host.toLowerCase(); |
| 92 | |
| 93 | return ( |
| 94 | hostLower === 'localhost' || |
| 95 | hostLower.startsWith('127.') || |
| 96 | hostLower === '[::1]' || |
| 97 | hostLower === '[0:0:0:0:0:0:0:1]' |
| 98 | ); |
| 99 | } |
| 100 | |
| 101 | module.exports = { |
| 102 | kReinitializeHandle: Symbol('kReinitializeHandle'), |
no outgoing calls
no test coverage detected
searching dependent graphs…